Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Can data be "consumed" with "get" method in REST?

 
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally when you submit an HTML form, the form data can be passed to the Controller with GET call.
Then why POSTMAN doesn't allow passing data with GET type call?

Thanks in advance
 
Saloon Keeper
Posts: 11928
254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just how the HTTP protocol works. GET requests don't have message bodies (or at least, they're not used).
 
Arun Singh Raaj
Ranch Hand
Posts: 240
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response.
May I know what is it 'message body' exactly? Isn't the form data a message body?
 
Sheriff
Posts: 67390
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While a GET is the default for the form element (which is a mystifying choice) you can easily set a form's HTTP method to POST.

Arun Singh Raaj wrote:Isn't the form data a message body?



No. When making a GET request, you will note that the request parameters are passed on the URL, not as x-www-form-urlencoded form data in the body as with POST.
 
Bear Bibeault
Sheriff
Posts: 67390
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Arun Singh Raaj wrote:May I know what is it 'message body' exactly?


https://developer.mozilla.org/en-US/docs/Web/HTTP/Messages
 
Well THAT's new! Comfort me, reliable tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic