Per this question: https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/1224 I'm trying to set the headers on my request, but it seems the interfaces have changed (e.g. there is no longer a initWithMiddleware
method on Client
. This is in an SPFx project, fyi.
I'm trying the following in my web part onInit:
protected onInit(): Promise<void> {
let provider = new SharePointProvider(this.context);
const client = Client.init();
client.api("v1.0").headers['X-PeopleQuery-QuerySources'] = 'Mailbox,Directory';
provider.graph = new Graph(client as any);
Providers.globalProvider = provider;
return super.onInit();
}
But it's not sending the headers.
Can anyone guide me on how to do this, if it's still possible?