The GET method is used to request access to a resource identified by the URI. The specified resource is parsed by the server to return the response content, that is, if the requested resource is text, it is returned as is. If it is a Common Gateway Interface (CGI) program, it returns the output after execution.
request | GET/index. HTTP / 1.1 HTML Host: www.dafada.jp |
---|---|
The response | Returns the page resource for index.heml |
request | GET /index.html HTTP/1.1 Host:www.dafada.jp if-modified-since: Thu,12 Jul 2016 08:30:00 GMT |
---|---|
The response | Returns only the resources of the index.html page that have been updated since 7.30 on July 12, 2012. If the content is Not updated, the response is 304 Not Modified |
The main purpose of POST is not to GET the main content of the response, although the function of POST is very similar to GET method.
request | POST /submit.cgi HTTP/1.1 Host:www.dafada.jp Content-Length:1560 |
---|---|
The response | Return submit.cgi to accept the result of processing the data |
The PUT method is used to transfer files, just like file uploading over FTP. It requires that the file content be included in the subject of the request packet and then saved to the location specified by the request URI. However, because HTTP/1.1’s PUT method does not have an authentication mechanism of its own, anyone can upload a file, and there are security issues, so it is not used by ordinary Web sites. In conjunction with the validation mechanisms of Web applications, live architectures that design comparable Web sites using REST (Representational State Transfer) standards may open up the use of the PUT method
request | HTML HTTP/1.1 Host:www.dafada.jp Content-Type:text/ HTML Content-Length:1560(1560 bytes of data) |
---|---|
The response | 204 Not Content(e.g. the HTML already exists on the server) |
###HEAD: The HEAD method is the same as the GET method, but does not return the body part of the packet. It is used to confirm the validity of the URI and the date and time of resource update
request | The HEAD/index. HTTP / 1.1 HTML Host: www.dafada.jp |
---|---|
The response | Returns the response header associated with index.html |
# # # DELETE: DELETE deletes a file. As opposed to PUT, DELETE deletes a specified resource according to the requested URI. However, HTTP/1.1’s DELETE method does not have an authentication mechanism like PUT. It may be open to use in conjunction with the validation mechanism of the Web application cache hierarchy, or in compliance with REST standards.
request | DELETE/index. HTTP / 1.1 HTML Host: www.dafada.jp |
---|---|
The response | The response returns a status code 204 No Content. |
The OPTIONS method is used to query the supported methods for the resource specified by the request URI
request | The OPTIONS * HTTP / 1.1 Host: www.dafada.jp |
---|---|
The response | HTTP/1.1 200OK Allow: GET/POST/HEAD/OPTIONS |
This method allows the Web server to TRACE back the previous request traffic to the client. When sending a request, the Web server fills the max-frowards header field with a value, and decreases the value by one each time it passes through the server. When the value decreases to 0, the transmission stops. Finally accepted to the request of the server returned a status code of 200 OK response to the client through the TRACE method can query request is sent out how to modify/processed tampered with, this is because the request want to link to the source and target server may be via the agent, the TRACE method is used to confirm the link in the process of a series of operations. But the TRACE method is not used much, and it is prone to XST attacks. Why not
request | Max TRACE/HTTP / 1.1 Host: www.dafada.jp – recently: 2 |
---|---|
The response | HTTP/1.1 200OK Content-Type:message/ HTTP Content-Length:1024 TRACE /HTTP/1.1 Host:www.dafada.jp Max-max-forwards :2(Return response contains request contents) |
The CONNECT method is required to establish a tunnel when the proxy server communication, to achieve TCP communication with the tunnel protocol. Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols are used to encrypt communications and then transmit them through network tunnels
request | The CONNECT proxy. Hackr. Jp: 8080 / HTTP / 1.1 Host: www.dafada.jp |
---|---|
The response | HTTP/1.1 200OK (after the network tunnel) |