Modify request headers per request C# HttpClient PCL

Yes, you can create a new HttpRequestMessage, set all the properties you need to, and then pass it to SendAsync.

var request = new HttpRequestMessage() {
   RequestUri = new Uri("http://example.org"),
   Method = HttpMethod.Post,
   Content = new StringContent("Here is my content")
}
request.Headers.Accept.Add(...);  // Set whatever headers you need to

var response = await client.SendAsync(request);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)