YuezhenQin / javaweb

0 stars 0 forks source link

HTTP request 的 4 个部分: 请求行 (HTTP method, URL, HTTP version type),请求头,空行,请求体 #15

Open YuezhenQin opened 2 months ago

YuezhenQin commented 2 months ago
  1. 请求的第一行是 “方法`URL `协议”
  2. 请求头
  3. 空行: 它表示请求头已经结束,请求体即将开始,承上启下。
  4. 请求体(请求正文) Image

Image

YuezhenQin commented 2 months ago

HTTP method

HTTP Method Description Effect
GET Requests data from a specified resource. 请求特定的页面信息,并返回。请求参数位于请求行
POST Submits data to be processed to a specified resource. 向特定的资源提交数据,请求参数包含在请求体之中。 可能会导致新的资源的建立/ 已存在资源的修改。
PUT Updates or replaces an existing resource. 替代已存在的资源
DELETE Deletes the specified resource. 请求删除特定的资源
PATCH Partially updates an existing resource.
HEAD Similar to GET, but only retrieves the headers.
OPTIONS Describes the communication options for the target resource.
CONNECT Establishes a tunnel to the server.
TRACE Performs a message loop-back test for debugging.