---
# System prepended metadata

title: 閒聊 HTTP Method 筆記
tags: [Talk]

---

---
title: 閒聊 HTTP Method 筆記
tags: Talk
---

https://mileschou.me/ironman/11th/authentication/day03/

## HTTP/0.9

### 1991

> This request consists of the word "GET", a space, the [document address](https://www.w3.org/Addressing/BNF.html#1) , omitting the "http:, host and port parts when they are the coordinates just used to make the connection. (If a gateway is being used, then a full document address may be given specifying a different naming scheme).

###### google 翻譯
> 該請求由單詞"GET"、一個空格、文檔地址組成，省略"http:"、主機和端口部分，因為它們是剛剛用於建立連接的坐標。（如果正在使用網關，那麼一個完整的文檔地址可以指定不同的命名方案）。

包括 GET => GET 只是其中之一的 method

```
GET /user
```

> The document address will consist of a single word (ie no spaces). If any further words are found on the request line, they MUST either be ignored, or else treated according to the [full HTTP spec](https://www.w3.org/Protocols/HTTP/HTTP2.html) .

###### google 翻譯
> 文檔地址將由一個單詞組成（即沒有空格）。如果在請求行中發現任何進一步的詞，它們必須要麼被忽略，要麼根據 [完整的 HTTP 規範] 處理

所以下面這兩個結果是一樣的，因為 `user` 會被忽略（ignored）

```
GET / user
GET /
```

### 1992

[Methods](https://www.w3.org/Protocols/HTTP/Methods.html) 定義

#### GET

> means retrieve whatever data is identified by the URI, so where the URI refers to a data-producing process, or a script which can be run by such a process, it is this data which will be returned, and not the source text of the script or process. Also used for searches .

###### google 翻譯

> 表示檢索由 URI 標識的任何資料，因此如果 URI 指的是資料生成進程或可由此類進程運行的腳本，則將返回此資料，而不是源文本腳本或過程。也用於搜索。

Example: Apache + PHP，必須要開 mod_php，如果沒開會回傳 PHP 原始碼

#### HEAD

> is the same as GET but returns only HTTP headers and no document body.

與 GET 相同，但只有 header 沒有 body

#### CHECKOUT

> Similar to GET but locks the object against update by other people. The lock may be broken by a higher authority or on timeout: in this case a future CHECKIN will fail. ( Phase out? )

###### google 翻譯

> 類似於 GET 但鎖定對像以防止其他人更新。可能上鎖失敗，因為其他人權限更高或 timeout：在這種情況下，未來的 CHECKIN 將失敗。 （ 淘汰？ ）

#### PUT

> specifies that the data in the body section is to be stored under the supplied URL. The URL must already exist. The new contenst of the document are the data part of the request. POST and REPLY should be used for creating new documents.

###### google 翻譯

> 指定正文部分中的數據將存儲在提供的 URL 下。URL 必須已經存在。文檔的新內容是請求的數據部分。POST和REPLY應該用於創建新文檔。

更新的內容是資料的一部分

#### CHECKIN

> Similar to PUT, but releases the lock set on the object. Fails if no lock has been set by CHECKOUT. Suggestion : phase out this (rcs-like) model in favor of the PUT (cvs-like, non-locking) model of code management.

###### google 翻譯

> 類似於 PUT，但釋放物件上設置的鎖。如果 CHECKOUT 沒有設置鎖，則失敗。建議：逐步淘汰這種（類 rcs）模型，轉而使用 PUT（類 cvs，非鎖定）代碼管理模型。

[rcs中文](https://dywang.csie.cyut.edu.tw/dywang/linuxProgram/node117.html)

#### SHOWMETHOD

> Returns a description (perhaps a form) for a given method when applied to the given object. The method name is specified in a For-Method: field. (TBS)

###### google 翻譯

> 當應用於給定物件時，返回給定方法的描述（可能是表單）。方法名稱在For-Method:字段中指定。 (待定)

> 後續翻到 OPTIONS 的時候再來回顧

#### DELETE

> Requests that the server delete the information corresponding to the given URL. After a successfull DELETE method, the URL becomes invalid for any future methods.

###### google 翻譯

> 請求服務器刪除與給定 URL 對應的信息。在一個成功的 DELETE 方法之後，該 URL 對以後的任何方法都無效。

#### POST

> Creates a new object linked to the specified object. The message-id field of the new object may be set by the client or else will be given by the server. A URL will be allocated by the server and returned to the client. The new document is the data part of the request. It is considered to be subordinate to the specified object, in the way that a file is subordinate to a directory containing it, or a news article is subordinate to a newsgroup to which it is posted.

###### google 翻譯

> 創建一個鏈接到指定物件的新物件。新物件的 message-id 字段可以由客戶端設置，也可以由服務器提供。一個 URL 將由服務器分配並返回給客戶端。新文檔是請求的數據部分。它被認為從屬於指定的物件，就像文件從屬於包含它的目錄一樣，或者新聞文章從屬於發布它的新聞組。

#### LINK

> Links an existing object to the specified object.

#### UNLINK

> Removes link (or other meta-) information from an object.

#### TEXTSEARCH

> The object may be queried with a text string. The search form of the GET method is used to query the object.

```
TEXTSEARCH /user
GET /user?annual+plants
```

#### SPACEJUMP

> The object will accept a query whose terms are the cooridnates of a point within the object. The method is implemented using GET with a derived URL .

#### SEARCH

> Proposed only. The index (etc) identified by the URL is to be searched for something matching in some sense the enclosed message. How does the client know what message fromats are acceptable to the server? (Suggestion of Fred Williams)

### HTTP/1.0

https://datatracker.ietf.org/doc/html/rfc1945

### HTTP/1.1

https://datatracker.ietf.org/doc/html/rfc2616

https://datatracker.ietf.org/doc/html/rfc7231
