- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 66 for 201 (0.01 seconds)
-
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) -
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) -
src/test/java/org/codelibs/fess/it/search/FavoritesApiTests.java
// Should return 200 or 201 int statusCode = response.getStatusCode(); assertTrue(statusCode == 200 || statusCode == 201, "Status code should be 200 or 201, but was " + statusCode); } } @Test public void testSetFavorite_noQueryId() {Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sat Dec 20 03:03:44 GMT 2025 - 9.9K bytes - Click Count (0) -
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) -
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) -
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) -
src/test/java/org/codelibs/fess/api/WebApiManagerTest.java
assertEquals(404, response.getStatus()); // Test with different status code manager = new StatusCodeWebApiManager(201); response = new TestHttpServletResponse(); manager.process(request, response, chain); assertEquals(201, response.getStatus()); } @Test public void test_process_withHeaderSetting() throws IOException, ServletException {
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sat Mar 21 06:04:58 GMT 2026 - 26.9K bytes - Click Count (0) -
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) -
src/test/java/org/codelibs/fess/helper/CoordinatorHelperTest.java
final AtomicReference<String> capturedPath = new AtomicReference<>(); final CoordinatorHelper helper = createCapturingHelper("node1@host1", capturedPath, capturedBody, createMockResponse(201, "{}")); helper.tryStartOperation("reindex", "fess"); assertNotNull(capturedBody.get()); final Map<String, Object> body = coordinatorHelper.parseJson(capturedBody.get());
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Sat Mar 28 06:59:19 GMT 2026 - 58.6K bytes - Click Count (0) -
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)