Skip to content

[zh-TW]: update HTTP Status 100 #27572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions files/zh-tw/web/http/reference/status/100/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,47 @@
title: 100 Continue
slug: Web/HTTP/Reference/Status/100
l10n:
sourceCommit: b085d5418eb8ef812682e647045746221bad0e7e
sourceCommit: 4d929bb0a021c7130d5a71a4bf505bcb8070378d
---

{{HTTPSidebar}}

HTTP **`100 Continue`** 資訊回應碼表示到目前為止一切正常,用戶端應該繼續請求,或者如果已經完成則忽略它
HTTP **`100 Continue`** [資訊回應](/zh-TW/docs/Web/HTTP/Reference/Status#資訊回應)狀態碼表示伺服器已收到請求的初始部分,且尚未拒絕。用戶應繼續發送請求,或者如果請求已經完成,則可以忽略 100 回應

為了讓伺服器檢查請求的標頭,用戶端必須在其初始請求中作為標頭發送 {{HTTPHeader("Expect")}}`: 100-continue`,並在收到 `100 Continue` 狀態碼的回應後才發送主體
當請求包含 {{HTTPHeader("Expect", "Expect: 100-continue")}} 標頭時,100 Continue 回應表示伺服器已準備好或能夠接收請求內容。如果用戶預期可能會發生錯誤,例如在未經驗證的情況下發送會改變狀態的操作,等待 100 Continue 回應會很有幫助

## 狀態

```http
100 Continue
```

## 範例

### 使用 100 Continue 的 PUT 請求

以下 {{HTTPMethod("PUT")}} 請求會向伺服器傳送有關檔案上傳的訊息。用戶會在收到 100 回應後才繼續傳送內容,以避免在網路上傳送可能因 {{HTTPStatus("405")}}、{{HTTPStatus("401")}} 或 {{HTTPStatus("403")}} 等錯誤而失敗的資料。首先,用戶僅傳送標頭,其中包含 {{HTTPHeader("Expect", "Expect: 100-continue")}} 標頭:

```http
PUT /videos HTTP/1.1
Host: uploads.example.com
Content-Type: video/h264
Content-Length: 123456789
Expect: 100-continue
```

伺服器回應請求可以繼續:

```http
HTTP/1.1 100 Continue
```

用戶接著傳送實際資料以完成請求:

```http
[作為 PUT 請求內容的視訊資料]
```

## 規範

{{Specifications}}
Expand Down