首页 > 解决方案 > Microsoft Graph Toolkit (MGT) - How do I modify/add request headers for the MGT-GET component?

问题描述

Trying to figure out how to modify request headers for the graph client toolkit and have it apply when using the GET component. I don't necessarily want to override the entire graph client.


For reference, here's how you do it:

// Already likely on page, adding as reference
TeamsProvider.microsoftTeamsLib = microsoftTeams;
const provider = new TeamsProvider(config);
    const options = {
        authProvider: provider,
        fetchOptions: { headers: {'ConsistencyLevel':'eventual'}}
    };     
    const client = Client.initWithMiddleware(options);
    provider.graph = new Graph(client)
// Now set provider with new graph
Providers.globalProvider = provider

标签: graphmicrosoft-graph-apimicrosoft-graph-toolkit

解决方案


推荐阅读