Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between http methods GET and HEAD

 
Luis Torres
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand what's the differences between GET and HEAD http methods.
Since I read HEAD method is just like GET but without body in the response, but also I read GET method don't have body just the header info.
So I don't understand what's is the actually the difference.
Thanks.
 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a client send a GET request, this request won't have a body. The server will respond to this request with an HTTP header (info abou the response such as content length etc) and body (the stuff the user will see).
but if you send a head request you will get the header without the body.
 
Luis Torres
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!!!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!