diff --git a/src/GraphQL.Client/GraphQLHttpRequest.cs b/src/GraphQL.Client/GraphQLHttpRequest.cs index c9d4e01a..d03b9f8e 100644 --- a/src/GraphQL.Client/GraphQLHttpRequest.cs +++ b/src/GraphQL.Client/GraphQLHttpRequest.cs @@ -35,7 +35,10 @@ public virtual HttpRequestMessage ToHttpRequestMessage(GraphQLHttpClientOptions }; message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/graphql-response+json")); message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - message.Headers.AcceptCharset.Add(new StringWithQualityHeaderValue("utf-8")); + message.Headers.AcceptCharset.Add(new StringWithQualityHeaderValue("utf-8")); + + // Explicitly setting content header to avoid issues with some GrahQL servers + message.Content.Headers.ContentType = new MediaTypeHeaderValue(options.MediaType); if (options.DefaultUserAgentRequestHeader != null) message.Headers.UserAgent.Add(options.DefaultUserAgentRequestHeader);