How to get an specific header value from the HttpResponseMessage

前端 未结 7 1810
挽巷
挽巷 2020-12-16 09:17

I\'m making an HTTP call. My response contains a session code X-BB-SESSION in the header section of the HttpResponseMessage object. How do I get th

相关标签:
7条回答
  • 2020-12-16 09:44

    Using Linq aswell, this is how I solved it.

    string operationLocation = response.Headers.GetValues("Operation-Location").FirstOrDefault();
    

    I think it's clean and not too long.

    0 讨论(0)
提交回复
热议问题