0

Suppose I have first=John and last=Doe and the following URL: http://<myurl>/<my controller>

How would the HTTP message (headers and body) look like for a client receiving a HTTP Post?

intuitivepixel
  • 23,302
  • 3
  • 57
  • 51
cybertextron
  • 10,547
  • 28
  • 104
  • 208
  • 1
    With which encoding? Also, why are you asking? Do you have a specific problem? With specific code? – John Saunders May 17 '13 at 21:08
  • @JohnSaunders UTF-8; I'm asking because I'm curious; I don't have a problem; No specific code – cybertextron May 17 '13 at 21:10
  • possible duplicate of [How to mimic an HTML form submission in a POST request?](http://stackoverflow.com/questions/8417224/how-to-mimic-an-html-form-submission-in-a-post-request) – Michelle Tilley May 17 '13 at 21:12
  • Easiest way I can think of to see this would be to build a simple form and execute it in the browser, while watching using [Fiddler](http://fiddler2.com/). You can view the raw request and response. – Joe Enos May 17 '13 at 21:12

1 Answers1

1

Something like below. You can use firebug browser plug-in to inspect the raw HTTP communication. You can also read this article for more details.

POST /mycontroller HTTP/1.1  
Host: localhost  
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8  
Accept-Language: en-us,en;q=0.5  
Accept-Encoding: gzip,deflate  
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7  
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded  
Content-Length: 20  

first=John&last=Doe
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327