• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

what is request body?

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear sir i would like to know one thing that with GET method data is setnt in request as query string but in POST method data are sent in request body.
Now confusion here is that what is request body?

with regard

Arun kumar maalik
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A HTTPRequest has a header and body. Read http://en.wikipedia.org/wiki/HTTP for more information.

To understand how HTTP works, I recommend that you install the tamperdata extension and liveHTTPheaders extensions for FireFox

http://tamperdata.mozdev.org/
http://livehttpheaders.mozdev.org/

Using these extensions, you can see what exactly is passed in the HTTP Header (using LiveHTTPHeaders extension) and what is passed in the HTTP Body (using TamperData extension).
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An HTTP request, is basically a stream of text.
That text is broken in to three sections.
1.) The request line
2.) The headers
3.) The body.

The header is a series of name/value pairs. The pairs are separated by a return/newline sequence. Name and value are separated by the colon character.
The end of the header section is marked of by two return/newline sequences together.
Everything after that is considered part of the body.

Here is an example POST request (caught with the packet sniffer, TcpFlow):


Line one is the request line.
Lines two through 13 are the headers.
Lines fourteen and fifteen mark the end of the headers
Line sixteen is the body.
The line numbers were added by me.

With GET requests there is no body.
[ September 06, 2006: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lynette and I criss-crossed posts.
Here advice about getting a browser plugin that shows the HTTP headers is excellent.
It's a lot easier to learn HTTP if you can visually see the request and response information in real time as you post to your app.
 
reply
    Bookmark Topic Watch Topic
  • New Topic