Forcing HttpClient to use Content-Type: text/xml

后端 未结 3 1049
一整个雨季
一整个雨季 2021-01-04 00:25

This is driving me nuts, I am setting the ContentType header everywhere I can and can\'t seem to make it stop sending text/plain.

Watching the data in Fiddler, the

3条回答
  •  离开以前
    2021-01-04 00:37

    Try settings the default request headers:

    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));
    

提交回复
热议问题