Answered HTTPWebRequest, Content-Type not send?

Robert_Zenz

Well-known member
Joined
Jun 3, 2008
Messages
503
Location
Vienna, Austria
Programming Experience
3-5
Hello.

I'm using HTTPWebRequest and WebResponse to send a XML-File to a server and receive the answer. However, it seems like that WebRequest isn't sending the Content-Type Header. At least I've checked it with lesswire.info - HTTP-Header-Test and the Content-Type header doesn't show up. I'm settging it using the ContentType Property.

Does it just not show up or is it really not sending the header?

Bobby
 
Last edited:
I tried a web request with content type to that address and it does pick it up.
 
Thanks for trying it.
Since your's requets worked I played a little around and found out that I'm messing with the headers after setting the Content-Type.

I didn't know that the Headers Collection-Property was also holding the Headers et by a fixed property...so I cleared it. :/

Thanks for the help!
Bobby
 
Back
Top