Getting _all_ request headersHi all, <br/> <br/> <br/> within my WCF RESTful service I'm trying to get all headers that are part of the according request. WCF provides programmatic acces through WebOperationContext.Current.IncomingWebRequestContext.Headers<br/> <br/> Unfortunately, it doesn't seem to be possible to retrieve the actual request string. One short example of an http request, so you'll understand what I mean:<br/> GET /index.php?user=johndoe HTTP/1.1<br/> Host: www.somepage.com<br/> User-Agent: Mozilla/4.0<br/> Accept: image/gif, image/jpeg, */*<br/> Connection: close<br/> <br/> How do I programmatically access the first line, i.e., <br/> GET /index.php?user=johndoe HTTP/1.1<br/> <br/> There is WebOperationContext.Current.IncomingWebRequestContext.Method but this does only return &quot;GET&quot;, not the string after (which I need to access for some reasons).<br/> I know that I can specify an UriTemplate and map the according bracket-contens to actual method parameters, but this is not what I need.<br/> Any ideas? Thank you!<br/> <br/> <br/> Best Regards<br/> Oliver.<br/> <br/>© 2009 Microsoft Corporation. All rights reserved.Fri, 03 Jul 2009 20:07:00 Z42762232-72bb-4e58-a42e-e0ed2327eb2fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#42762232-72bb-4e58-a42e-e0ed2327eb2fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#42762232-72bb-4e58-a42e-e0ed2327eb2fOliver Salahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Oliver%20SalahGetting _all_ request headersHi all, <br/> <br/> <br/> within my WCF RESTful service I'm trying to get all headers that are part of the according request. WCF provides programmatic acces through WebOperationContext.Current.IncomingWebRequestContext.Headers<br/> <br/> Unfortunately, it doesn't seem to be possible to retrieve the actual request string. One short example of an http request, so you'll understand what I mean:<br/> GET /index.php?user=johndoe HTTP/1.1<br/> Host: www.somepage.com<br/> User-Agent: Mozilla/4.0<br/> Accept: image/gif, image/jpeg, */*<br/> Connection: close<br/> <br/> How do I programmatically access the first line, i.e., <br/> GET /index.php?user=johndoe HTTP/1.1<br/> <br/> There is WebOperationContext.Current.IncomingWebRequestContext.Method but this does only return &quot;GET&quot;, not the string after (which I need to access for some reasons).<br/> I know that I can specify an UriTemplate and map the according bracket-contens to actual method parameters, but this is not what I need.<br/> Any ideas? Thank you!<br/> <br/> <br/> Best Regards<br/> Oliver.<br/> <br/>Thu, 02 Jul 2009 14:40:15 Z2009-07-02T14:40:15Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#d3d3a791-dd9c-453d-a1b3-d0327389c8fahttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#d3d3a791-dd9c-453d-a1b3-d0327389c8faCarlos Figueirahttp://social.msdn.microsoft.com/Profile/en-US/?user=Carlos%20FigueiraGetting _all_ request headersYou can try<br/><br/><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small"><font size=2 color="#2b91af"><font size=2 color="#2b91af"> <p>WebOperationContext</p> </font></font></span><font size=2 color="#2b91af"> <p> </p> </font></span> <p><span style="font-size:x-small">.Current.IncomingRequest.UriTemplateMatch.RequestUri;</span></p> That will give you the absolute URI of the request (something like <a href="http://www.somepage.com/index.php?user=johndoe">http://www.somepage.com/index.php?user=johndoe</a>), you can parse the request (take the host out of it) to get the URI part of the first line of the HTTP request.Thu, 02 Jul 2009 15:01:26 Z2009-07-02T15:01:26Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#33606672-e4a6-42cf-8dd2-2a01b10edc3fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/42762232-72bb-4e58-a42e-e0ed2327eb2f#33606672-e4a6-42cf-8dd2-2a01b10edc3fOliver Salahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Oliver%20SalahGetting _all_ request headersThanks Carlos! This is exactly what I was looking for! :-)Fri, 03 Jul 2009 20:07:00 Z2009-07-03T20:07:00Z