Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 30 for ORJSONResponse (0.05 sec)

  1. docs_src/custom_response/tutorial001b_py39.py

    from fastapi import FastAPI
    from fastapi.responses import ORJSONResponse
    
    app = FastAPI()
    
    
    @app.get("/items/", response_class=ORJSONResponse)
    async def read_items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 215 bytes
    - Viewed (0)
  2. docs/ru/docs/advanced/custom-response.md

    ///
    
    ## Используйте `ORJSONResponse` { #use-orjsonresponse }
    
    Например, если вы выжимаете максимум производительности, вы можете установить и использовать <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> и задать ответ как `ORJSONResponse`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  3. tests/test_orjson_response_class.py

    from fastapi import FastAPI
    from fastapi.responses import ORJSONResponse
    from fastapi.testclient import TestClient
    from sqlalchemy.sql.elements import quoted_name
    
    app = FastAPI(default_response_class=ORJSONResponse)
    
    
    @app.get("/orjson_non_str_keys")
    def get_orjson_non_str_keys():
        key = quoted_name(value="msg", quote=False)
        return {key: "Hello World", 1: 1}
    
    
    client = TestClient(app)
    
    
    def test_orjson_non_str_keys():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Sep 02 10:17:31 UTC 2022
    - 562 bytes
    - Viewed (0)
  4. docs_src/custom_response/tutorial010_py39.py

    from fastapi import FastAPI
    from fastapi.responses import ORJSONResponse
    
    app = FastAPI(default_response_class=ORJSONResponse)
    
    
    @app.get("/items/")
    async def read_items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 205 bytes
    - Viewed (0)
  5. docs/es/docs/advanced/custom-response.md

    ///
    
    ## Usa `ORJSONResponse` { #use-orjsonresponse }
    
    Por ejemplo, si estás exprimendo el rendimiento, puedes instalar y usar <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> y establecer el response como `ORJSONResponse`.
    
    Importa la clase `Response` (sub-clase) que quieras usar y declárala en el *path operation decorator*.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  6. docs/en/docs/advanced/custom-response.md

    ///
    
    ## Use `ORJSONResponse` { #use-orjsonresponse }
    
    For example, if you are squeezing performance, you can install and use <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> and set the response to be `ORJSONResponse`.
    
    Import the `Response` class (sub-class) you want to use and declare it in the *path operation decorator*.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  7. docs/de/docs/advanced/custom-response.md

    ///
    
    ## `ORJSONResponse` verwenden { #use-orjsonresponse }
    
    Um beispielsweise noch etwas Leistung herauszuholen, können Sie <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> installieren und die Response als `ORJSONResponse` setzen.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.4K bytes
    - Viewed (0)
  8. docs/pt/docs/advanced/custom-response.md

    ///
    
    ## Utilizando `ORJSONResponse` { #use-orjsonresponse }
    
    Por exemplo, se você precisa bastante de performance, você pode instalar e utilizar o <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> e definir a resposta para ser uma `ORJSONResponse`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.8K bytes
    - Viewed (0)
  9. fastapi/responses.py

        """
    
        def render(self, content: Any) -> bytes:
            assert ujson is not None, "ujson must be installed to use UJSONResponse"
            return ujson.dumps(content, ensure_ascii=False).encode("utf-8")
    
    
    class ORJSONResponse(JSONResponse):
        """
        JSON response using the high-performance orjson library to serialize data to JSON.
    
        Read more about it in the
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/custom-response.md

    /// note | 说明
    
    如果你使用不带有任何媒体类型的响应类,FastAPI 认为你的响应没有任何内容,所以不会在生成的OpenAPI文档中记录响应格式。
    
    ///
    
    ## 使用 `ORJSONResponse`
    
    例如,如果你需要压榨性能,你可以安装并使用 <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> 并将响应设置为 `ORJSONResponse`。
    
    导入你想要使用的 `Response` 类(子类)然后在 *路径操作装饰器* 中声明它。
    
    {* ../../docs_src/custom_response/tutorial001b.py hl[2,7] *}
    
    /// info | 提示
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 7.5K bytes
    - Viewed (0)
Back to top