Skip to content

Async Issue with Headers #7

@christophwille

Description

@christophwille

https://github.com/microsoftgraph/consoleApp-deltaQuery-dotNet-sample/blob/master/Client/Client.cs#L202

private void AddHeaders(WebClient webClient)
{
webClient.Headers.Add(Constants.HeaderNameAuthorization, this.GetAccessToken().Result);
webClient.Headers.Add(HttpRequestHeader.Accept, "application/json");
}

.Result - please be async/await all the way down. The use of .Result is a very bad idea. (if not async/await then at least .GetAwaiter().GetResult())

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions