• 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 the meaning of POST has a body ?

 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, What is the meaning of POST has a body ? GET has no body ?
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basic HTTP. POST has a body in which data can be posted. GET does not.
 
Ranch Hand
Posts: 97
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 110
Google Web Toolkit Java Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic