HTTP Message Methods - Part 2 of Chapter 3 from HTTP: The Definitive Guide (2/4)
[previous] [next] |
HTTP: The Definitive Guide, Chapter 3: HTTP Messages
PUT
The PUT method writes documents to a server, in the inverse of the way that GET reads documents from a server. Some publishing systems let you create web pages and install them directly on a web server using PUT (see Figure 3-9).
The semantics of the PUT method are for the server to take the body of the request and either use it to create a new document named by the requested URL or, if that URL already exists, use the body to replace it.
Because PUT allows you to change content, many web servers require you to log in with a password before you can perform a PUT. You can read more about password authentication in Chapter 12.
POST
The POST method was designed to send input data to the server.[3] In practice, it is often used to support HTML forms. The data from a filled-in form typically is sent to the server, which then marshals it off to where it needs to go (e.g., to a server gateway program, which then processes it). Figure 3-10 shows a client making an HTTP request--sending form data to a server--with the POST method.
3. POST is used to send data to a server. PUT is used to deposit data into a resource on the server (e.g., a file). Back
[previous] [next] |
Created: January 21, 2003
Revised: January 21, 2003
URL: https://webreference.com/programming/http/chap3/2/2.html