• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the meaning of POST has a body ?

 
Harikrishna Gorrepati
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, What is the meaning of POST has a body ? GET has no body ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64617
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic HTTP. POST has a body in which data can be posted. GET does not.
 
Gaurav Sagar
Ranch Hand
Posts: 97
Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harikrishna Gorrepati wrote:Hi, What is the meaning of POST has a body ? GET has no body ?


The POST has the ability to carry data as PAYLOAD, whereas the GET doesn't has this type of special capability. Henceforth, since POST ought to carry data with itself, it has body. Hope you are not concerned with the body of the method i.e. the code. In that case its empty as a default for you to override.

Regards,
Gaurav
 
Jayr Motta
Ranch Hand
Posts: 110
Google App Engine Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harikrishna,

It's because if you want to send data to the server you can use some mechanisms, one of them is the URL through http parameters (those with &name=value), and other is the body. The body does the same of the URL while sending data to the server, however, there is some benefits and some limitations,

Using URL you can bookmark it, which allow your users to restore the state of your application through just URL in an RESTful manner.
Using body you don't have any size limit. (There is size limit with URL because most part of browsers limit a maximum of characters in the URL, however, there is no such limitation on the HTTP specification)
Using URL all data is sent to the URL when submiting some data, with body it doesn't. (let's say you want to send some password to the server, you'll not want that it appear on the URL)

The body is also called payload, because it's in bytes how much you've to pay to get that load of data.

About the second answer. No, GET has no body, it just carries the basics HTTP headers / info. It's because in theory how his name explicit, it's just a call to get something, not to send. While with POST you're posting something to the server.

Hope it helps!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic