I'm trying to get the raw data sent to IIS using a HttpHandler. However, because the request is an "GET"-request without the "Content-Length" header set it reports that there is no data to read (TotalBytes), and the inputstream is empty. Is there any way I can plug into the IIS-pipeline (maybe even before the request is parsed) and just kind of take control over the request and read it's raw data? I don't care if I need to parse headers and stuff like that myself, I just want to get my hands on the actual request and tell IIS to ignore this one. Is that at all possible? Cause right now it looks like I need to do the alternative, which is developing a custom standalone server, and I really don't want to do that.
Asked
Active
Viewed 563 times
1 Answers
0
Most web servers will ignore (and rarely give you access to) the body of a GET request, because the HTTP semantics imply that it is to be ignored anyway. You should consider another method (for example POST or PUT).
See this question and the link in this answer: HTTP GET with request body
-
Using GET is a requirement I'm afraid. – Alxandr May 28 '11 at 14:12
-
@Alxandr, I can't comment on where this requirement comes from, but it's going against the HTTP specification: don't expect much interoperability with existing servers in this case. (I wouldn't be surprised if some proxy servers filtered out bodies in GET requests, or even plainly rejected them). – Bruno May 28 '11 at 14:16
-
It's a websocket request, so I'm still following a specification though. – Alxandr May 28 '11 at 14:20