HttpClient does not return Content-Type

后端 未结 2 1245
轻奢々
轻奢々 2021-01-13 10:32

I\'m sending a request with HttpClient. Server returns two headers which I want return to client. I run it like this:

 using (var client = new          


        
相关标签:
2条回答
  • 2021-01-13 10:45

    You should look at response.Content.Headers you should find headers relating to the content here. More information about all the content header types can be found on the msdn link below.

    https://msdn.microsoft.com/en-us/library/system.net.http.headers.httpcontentheaders(v=vs.118).aspx

    0 讨论(0)
  • 2021-01-13 10:52

    Content_type is part of the Content Headers. So you should use:

    response.Content.Headers;
    
    0 讨论(0)
提交回复
热议问题