Jul 24, 2012 at 2:19 PM
Edited Jul 24, 2012 at 2:23 PM
OK, let's say I have some arbitrary HTTP response as string (or stored as byte array)
status: 200 OK
x-xss-protection: 1; mode=block
content-type: application/json; charset=UTF-8
cache-control: private, max-age=0
I need to parse this to create an HttpResponseMessage. And on the hand, be able to dump an HttpResponseMessage and store it away.
Is there anything exposed for me to be able to do that the same way Web API does it? I have not yet found anything. With content, it is fairly easy to do and setting the response code and reason phrase easy but
setting headers is tough.
Problem is this header contains both content level headers and HttpResponseMessage level headers and I would have to know which one goes where.
So is there an easy way for me to do this please?