• 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

query about GET and POST methods

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends,

i have a small query. We use GET for getting a response and POST to post to server. taken into account the security related and other differences between the two methods,
we can still 'GET' a response using the POST method. so why to use GET? i mean y are there two different methods if one of them can perform the same tasks.

may sound a dumb question.but please reply.

thank you.
 
Sheriff
Posts: 67746
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
Ou have some incorrect concepts around these HTTP methods, and HTTP in general.

amit daundkar wrote:i have a small query. We use GET for getting a response and POST to post to server.

Not quite. All requests will result in a response, be they GET, POST, PUT, DELETE, or any other HTTP method.

The difference is in how the methods are to be used.

taken into account the security related and other differences between the two methods,

There is no difference in security between any of the methods. None. At all.

we can still 'GET' a response using the POST method. so why to use GET?

GET is intended for just what is says -- to GET something from the server. GETs should be idempotent -- that is, repeating the same GET over and over again should get the same response.

GETs pass request parameters on the URL.

POSTs can be non-idempotent, that is, return different response results based upon what happens on the server.

POSTs pass request parameters in the request body.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic