Quickie: WebRequest & Post/Get

Just a quick note, when using the System.Net.WebRequest to do a POST or a GET (or any other Method), make sure the Method you specify is in all upper case.  Method is used to indicate the "Method Definition" of the HTTP request, and as RFC 2616 Section 4.2 indicates the Message Headers ARE case sensitive.

 

References:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetWebRequestClassTopic.asp

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetWebRequestClassMethodTopic.asp

 

 

No Comments