HTTP methods

The method that is the first word in the status line of the request tells the server what to do with the request. The standard defines different methods, such as GET, HEAD, POST, PUT, DELETE, and others.

The client uses the GET method when it wants to get the content of a resource. In the case of a GET request, the body of the request is empty. This is the method used by the browser when we download a web page. JavaScript programs use this method many times when they want to get some information from the server, but do not want to send much information to the server.

When the client uses POST, the intention is usually to send data to the server. The server replies and, very often, there is also a body in the reply. However, the ...

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.