Hi,
How can i read HTTP response headers from web service response in C#?
Best Regards,
Guy Bertental
Hi,
How can i read HTTP response headers from web service response in C#?
Best Regards,
Guy Bertental
Can't you just refer to HttpContext.Current.Response.Headers in your webservice?
I'm not sure if that'll work.
If you're getting back an HttpResponse, you can just query the HttpResponse.Headers property.
thanks for your replies, after digging the MSDN, all i needed to do is to override the GetWebResponse method and than i could access the response headers:
public class MyWSProxy : HttpWebClientProtocol
{
protected override WebResponse GetWebResponse(WebRequest request)
{
System.Net.WebResponse wr = base.GetWebResponse(request);
// read a response header
object val = wr.Headers["key"];
return wr;
}
}
thanks anyways, Guy Bertental