Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 48 for 201 (0.08 seconds)

  1. docs_src/response_status_code/tutorial001_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.post("/items/", status_code=201)
    async def create_item(name: str):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 145 bytes
    - Click Count (0)
  2. docs/en/docs/tutorial/response-status-code.md

    * **`200 - 299`** are for "Successful" responses. These are the ones you would use the most.
        * `200` is the default status code, which means everything was "OK".
        * Another example would be `201`, "Created". It is commonly used after creating a new record in the database.
        * A special case is `204`, "No Content".  This response is used when there is no content to return to the client, and so the response must not have a body.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 3.9K bytes
    - Click Count (0)
  3. internal/event/rules_test.go

    		{"", "jpg", "*jpg"},
    		{"", "*jpg", "*jpg"},
    		{"images/", "jpg", "images/*jpg"},
    		{"images/*", "jpg", "images/*jpg"},
    		{"images/", "*jpg", "images/*jpg"},
    		{"images/*", "*jpg", "images/*jpg"},
    		{"201*/images/", "jpg", "201*/images/*jpg"},
    	}
    
    	for i, testCase := range testCases {
    		result := NewPattern(testCase.prefix, testCase.suffix)
    
    		if result != testCase.expectedResult {
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 8.8K bytes
    - Click Count (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/CallKotlinTest.kt

          override fun writeTo(sink: BufferedSink) {
            sink.writeUtf8("<element/>")
            sink.flush()
          }
        }
    
        server.enqueue(MockResponse(code = 201))
        server.enqueue(MockResponse(code = 204))
        server.enqueue(MockResponse(code = 204))
    
        val endpointUrl = server.url("/endpoint")
    
        var request =
          Request
            .Builder()
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Fri Jun 20 11:46:46 GMT 2025
    - 8.4K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/tutorial/response-status-code.md

    ///
    
    在 HTTP 中,你會在回應的一部分傳回 3 位數的狀態碼。
    
    這些狀態碼有對應的名稱以便辨識,但重點是數字本身。
    
    簡而言之:
    
    * `100 - 199` 表示「資訊」。你很少會直接使用它們。這些狀態碼的回應不可包含本文。
    * **`200 - 299`** 表示「成功」。這是你最常使用的一組。
        * `200` 是預設狀態碼,表示一切「OK」。
        * 另一個例子是 `201`,代表「已建立」。常用於在資料庫中建立新紀錄之後。
        * 一個特殊情況是 `204`,代表「無內容」。當沒有內容要回傳給用戶端時使用,因此回應不得有本文。
    * **`300 - 399`** 表示「重新導向」。這些狀態碼的回應可能有或沒有本文,唯獨 `304`(「未修改」)必須沒有本文。
    * **`400 - 499`** 表示「用戶端錯誤」。這大概是你第二常用的一組。
        * 例如 `404`,代表「找不到」。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  6. docs/en/docs/advanced/response-change-status-code.md

    ## Use case { #use-case }
    
    For example, imagine that you want to return an HTTP status code of "OK" `200` by default.
    
    But if the data didn't exist, you want to create it, and return an HTTP status code of "CREATED" `201`.
    
    But you still want to be able to filter and convert the data you return with a `response_model`.
    
    For those cases, you can use a `Response` parameter.
    
    ## Use a `Response` parameter { #use-a-response-parameter }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 1.5K bytes
    - Click Count (0)
  7. docs/en/docs/advanced/additional-status-codes.md

    But you also want it to accept new items. And when the items didn't exist before, it creates them, and returns an HTTP status code of 201 "Created".
    
    To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 2K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/advanced/additional-status-codes.md

    它會使用預設的狀態碼,或你在路徑操作中設定的狀態碼。
    
    ## 額外的狀態碼 { #additional-status-codes_1 }
    
    如果你想在主要狀態碼之外再回傳其他狀態碼,可以直接回傳一個 `Response`(例如 `JSONResponse`),並直接設定你想要的額外狀態碼。
    
    例如,你想要有一個允許更新項目的路徑操作,成功時回傳 HTTP 狀態碼 200 "OK"。
    
    但你也希望它能接受新項目;當項目先前不存在時就建立它們,並回傳 HTTP 狀態碼 201 "Created"。
    
    要達成這點,匯入 `JSONResponse`,直接在那裡回傳內容,並設定你想要的 `status_code`:
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    /// warning
    
    當你直接回傳一個 `Response`(就像上面的範例),它會原封不動地被送出。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 1.8K bytes
    - Click Count (0)
  9. docs/ja/docs/advanced/additional-status-codes.md

    メインのステータスコードとは別に追加のステータスコードを返したい場合は、`JSONResponse` のような `Response` を直接返し、追加のステータスコードを直接設定できます。
    
    たとえば、item を更新でき、成功時に HTTP ステータスコード 200 "OK" を返す *path operation* を作りたいとします。
    
    しかし、新しい item も受け付けたいとします。そして、item が以前存在しなかった場合には作成し、HTTP ステータスコード 201「Created」を返します。
    
    これを実現するには、`JSONResponse` をインポートし、望む `status_code` を設定して、そこで内容を直接返します。
    
    {* ../../docs_src/additional_status_codes/tutorial001_an_py310.py hl[4,25] *}
    
    /// warning
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  10. docs/ja/docs/tutorial/response-status-code.md

    つまり:
    
    * `100 - 199` は「情報」のためのものです。直接使うことはほとんどありません。これらのステータスコードを持つレスポンスはボディを持つことができません。
    * **`200 - 299`** は「成功」のレスポンスのためのものです。これらは最も利用するであろうものです。
        * `200`はデフォルトのステータスコードで、すべてが「OK」であったことを意味します。
        * 別の例としては、`201`(Created)があります。これはデータベースに新しいレコードを作成した後によく使用されます。
        * 特殊なケースとして、`204`(No Content)があります。このレスポンスはクライアントに返すコンテンツがない場合に使用されるため、レスポンスはボディを持ってはいけません。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 5.6K bytes
    - Click Count (0)
Back to Top