title: How to change Content-Type in Flurl?
body: <p>I have a .NET Core 2.0 WebApi application in which I have added the "Flurl.Http" (Version 2.1.0) NuGet package to my project.</p>
  
  <p>I am trying to use Flurl to make a simple REST API call to one of Visual Studio Team Services' (VSTS) Api endpoints.</p>
  
  <p>However, the particular VSTS api endpoint that I am calling requires that the Content-Type be set to "application/json-patch+json" instead of the typical "application/json".</p>
  
  <p>In my Flurl call, I am using the "WithHeader()" method to try and set the Content-Type in the header of the request, but it is not working. Flurl seems to not allow me to override the default or standard Content-Type that is built into the PostJsonAsync method.</p>
  
  <p>Does anyone know how to change the Content-Type of the request using Flurl? Or how to properly override the default behavior of the Content-Type in the Flurl configuration?</p>
  
  <p>Thanks in advance!</p>
  
  <p>My code:</p>
  
  <pre><code>public bool CreateNewBug(NewBugRequest newBugRequest)
  {
      return _apiUrlToCreateNewBug.WithHeader("Authorization", "Basic Base64PersonalAccessTokenGoesHere")
                                  .WithHeader("Content-Type", "application/json-patch+json")
                                  .PostJsonAsync(newBugRequest.Fields)
                                  .Result
                                  .IsSuccessStatusCode;
  }
  </code></pre>
  
  <p><em>(This code works, but the response from the VSTS api is that the Content-Type is not allowed and needs to be changed to "application/json-patch+json", which is what I tried to set it to in the header.)</em></p>