Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 125 for JSONResponse (0.14 sec)

  1. docs/fr/docs/advanced/response-directly.md

    Ensuite, en arrière-plan, il mettra ces données JSON-compatible (par exemple un `dict`) à l'intérieur d'un `JSONResponse` qui sera utilisé pour envoyer la réponse au client.
    
    Mais vous pouvez retourner une `JSONResponse` directement à partir de vos *opérations de chemin*.
    
    Cela peut être utile, par exemple, pour retourner des en-têtes personnalisés ou des cookies.
    
    ## Renvoyer une `Response`
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/fess/app/web/api/admin/dict/stopwords/ApiAdminDictStopwordsAction.java

    import org.codelibs.fess.dict.stopwords.StopwordsFile;
    import org.codelibs.fess.dict.stopwords.StopwordsItem;
    import org.lastaflute.web.Execute;
    import org.lastaflute.web.response.JsonResponse;
    import org.lastaflute.web.response.StreamResponse;
    
    import jakarta.annotation.Resource;
    
    public class ApiAdminDictStopwordsAction extends FessApiAdminAction {
    
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:53:18 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  3. docs/de/docs/advanced/additional-status-codes.md

    # Zusätzliche Statuscodes
    
    Standardmäßig liefert **FastAPI** die Rückgabewerte (Responses) als `JSONResponse` zurück und fügt den Inhalt der jeweiligen *Pfadoperation* in das `JSONResponse` Objekt ein.
    
    Es wird der Default-Statuscode oder derjenige verwendet, den Sie in Ihrer *Pfadoperation* festgelegt haben.
    
    ## Zusätzliche Statuscodes
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  4. docs/pt/docs/advanced/additional-status-codes.md

    # Códigos de status adicionais
    
    Por padrão, o **FastAPI** retornará as respostas utilizando o `JSONResponse`, adicionando o conteúdo do retorno da sua *operação de caminho* dentro do `JSONResponse`.
    
    Ele usará o código de status padrão ou o que você definir na sua *operação de caminho*.
    
    ## Códigos de status adicionais
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/fess/app/web/api/admin/storage/ApiAdminStorageAction.java

    import org.lastaflute.web.response.JsonResponse;
    import org.lastaflute.web.response.StreamResponse;
    
    public class ApiAdminStorageAction extends FessApiAdminAction {
    
        private static final Logger logger = LogManager.getLogger(ApiAdminStorageAction.class);
    
        // GET /api/admin/storage/list/{id}
        // POST /api/admin/storage/list/{id}
        @Execute
        public JsonResponse<ApiResult> list(final OptionalThing<String> id) {
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  6. fastapi/exception_handlers.py

            return Response(status_code=exc.status_code, headers=headers)
        return JSONResponse(
            {"detail": exc.detail}, status_code=exc.status_code, headers=headers
        )
    
    
    async def request_validation_exception_handler(
        request: Request, exc: RequestValidationError
    ) -> JSONResponse:
        return JSONResponse(
            status_code=HTTP_422_UNPROCESSABLE_ENTITY,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 19:08:14 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/fess/app/web/api/admin/duplicatehost/ApiAdminDuplicatehostAction.java

    import org.codelibs.fess.app.web.api.admin.FessApiAdminAction;
    import org.codelibs.fess.es.config.exentity.DuplicateHost;
    import org.lastaflute.web.Execute;
    import org.lastaflute.web.response.JsonResponse;
    
    import jakarta.annotation.Resource;
    
    /**
     * @author Keiichi Watanabe
     */
    public class ApiAdminDuplicatehostAction extends FessApiAdminAction {
    
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:53:18 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  8. docs/zh/docs/advanced/additional-status-codes.md

    # 额外的状态码
    
    **FastAPI** 默认使用 `JSONResponse` 返回一个响应,将你的 *路径操作* 中的返回内容放到该 `JSONResponse` 中。
    
    **FastAPI** 会自动使用默认的状态码或者使用你在 *路径操作* 中设置的状态码。
    
    ## 额外的状态码
    
    如果你想要返回主要状态码之外的状态码,你可以通过直接返回一个 `Response` 来实现,比如 `JSONResponse`,然后直接设置额外的状态码。
    
    例如,假设你想有一个 *路径操作* 能够更新条目,并且更新成功时返回 200 「成功」 的 HTTP 状态码。
    
    但是你也希望它能够接受新的条目。并且当这些条目不存在时,会自动创建并返回 201 「创建」的 HTTP 状态码。
    
    要实现它,导入 `JSONResponse`,然后在其中直接返回你的内容,并将 `status_code` 设置为为你要的值。
    
    ```Python hl_lines="4  25"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  9. docs_src/additional_status_codes/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Body, FastAPI, status
    from fastapi.responses import JSONResponse
    
    app = FastAPI()
    
    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[Union[str, None], Body()] = None,
        size: Annotated[Union[int, None], Body()] = None,
    ):
        if item_id in items:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 705 bytes
    - Viewed (0)
  10. docs_src/additional_responses/tutorial003.py

    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    class Message(BaseModel):
        message: str
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={
            404: {"model": Message, "description": "The item was not found"},
            200: {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 837 bytes
    - Viewed (0)
Back to top