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
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: GET /index.php?user=johndoe HTTP/1.1 Host: www.somepage.com User-Agent: Mozilla/4.0 Accept: image/gif, image/jpeg, */* Connection: close
How do I programmatically access the first line, i.e., GET /index.php?user=johndoe HTTP/1.1
There is WebOperationContext.Current.IncomingWebRequestContext.Method but this does only return "GET", not the string after (which I need to access for some reasons). 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. Any ideas? Thank you!
That will give you the absolute URI of the request (something like http://www.somepage.com/index.php?user=johndoe), you can parse the request (take the host out of it) to get the URI part of the first line of the HTTP request.
Marcado como RespostaOliver Salahsexta-feira, 3 de julho de 2009 20:06
That will give you the absolute URI of the request (something like http://www.somepage.com/index.php?user=johndoe), you can parse the request (take the host out of it) to get the URI part of the first line of the HTTP request.
Marcado como RespostaOliver Salahsexta-feira, 3 de julho de 2009 20:06