Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 886 for orjson (0.04 sec)

  1. fastapi/responses.py

        """
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed to use ORJSONResponse"
            return orjson.dumps(
                content, option=orjson.OPT_NON_STR_KEYS | orjson.OPT_SERIALIZE_NUMPY
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. docs_src/custom_response/tutorial009c_py39.py

    from typing import Any
    
    import orjson
    from fastapi import FastAPI, Response
    
    app = FastAPI()
    
    
    class CustomORJSONResponse(Response):
        media_type = "application/json"
    
        def render(self, content: Any) -> bytes:
            assert orjson is not None, "orjson must be installed"
            return orjson.dumps(content, option=orjson.OPT_INDENT_2)
    
    
    @app.get("/", response_class=CustomORJSONResponse)
    async def main():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 451 bytes
    - Viewed (0)
  3. docs/en/docs/advanced/custom-response.md

    For example, let's say that you want to use <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, but with some custom settings not used in the included `ORJSONResponse` class.
    
    Let's say you want it to return indented and formatted JSON, so you want to use the orjson option `orjson.OPT_INDENT_2`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 12.4K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/custom-response.md

    Nehmen wir zum Beispiel an, dass Sie <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> verwenden möchten, aber mit einigen benutzerdefinierten Einstellungen, die in der enthaltenen `ORJSONResponse`-Klasse nicht verwendet werden.
    
    Sie möchten etwa, dass Ihre Response eingerücktes und formatiertes JSON zurückgibt. Dafür möchten Sie die orjson-Option `orjson.OPT_INDENT_2` verwenden.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.4K bytes
    - Viewed (0)
  5. docs/ko/docs/advanced/custom-response.md

    ### `JSONResponse`
    
    데이터를 받아 `application/json`으로 인코딩된 응답을 반환합니다.
    
    이는 위에서 설명했듯이 **FastAPI**에서 기본적으로 사용되는 응답 형식입니다.
    
    ### `ORJSONResponse`
    
     <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>을 사용하여 빠른 JSON 응답을 제공하는 대안입니다. 위에서 설명한 내용과 같습니다.
    
    /// info | 정보
    
    이를 사용하려면 `orjson`을 설치해야합니다. 예: `pip install orjson`.
    
    ///
    
    ### `UJSONResponse`
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 15 11:21:20 UTC 2025
    - 13.4K bytes
    - Viewed (0)
  6. docs/ru/docs/advanced/custom-response.md

    Например, предположим, что вы хотите использовать <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, но с некоторыми пользовательскими настройками, которые не используются во встроенном классе `ORJSONResponse`.
    
    Скажем, вы хотите, чтобы возвращался отформатированный JSON с отступами, то есть хотите использовать опцию orjson `orjson.OPT_INDENT_2`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 19.7K bytes
    - Viewed (0)
  7. docs/pt/docs/advanced/custom-response.md

    Por exemplo, vamos supor que você queira utilizar o <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, mas com algumas configurações personalizadas que não estão incluídas na classe `ORJSONResponse`.
    
    Vamos supor também que você queira retornar um JSON indentado e formatado, então você quer utilizar a opção `orjson.OPT_INDENT_2` do orjson.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.8K bytes
    - Viewed (0)
  8. docs/es/docs/advanced/custom-response.md

    Por ejemplo, digamos que quieres usar <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, pero con algunas configuraciones personalizadas no utilizadas en la clase `ORJSONResponse` incluida.
    
    Digamos que quieres que devuelva JSON con sangría y formato, por lo que quieres usar la opción de orjson `orjson.OPT_INDENT_2`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  9. requirements-tests.txt

    strawberry-graphql >=0.200.0,< 1.0.0
    anyio[trio] >=3.2.1,<5.0.0
    PyJWT==2.9.0
    pyyaml >=5.3.1,<7.0.0
    pwdlib[argon2] >=0.2.1
    inline-snapshot>=0.21.1
    pytest-codspeed==4.2.0
    # types
    types-ujson ==5.10.0.20240515
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 394 bytes
    - Viewed (0)
  10. docs/zh/docs/advanced/custom-response.md

    ### `JSONResponse`
    
    接受数据并返回一个 `application/json` 编码的响应。
    
    如上文所述,这是 **FastAPI** 中使用的默认响应。
    
    ### `ORJSONResponse`
    
    如上文所述,`ORJSONResponse` 是一个使用 <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> 的快速的可选 JSON 响应。
    
    
    ### `UJSONResponse`
    
    `UJSONResponse` 是一个使用 <a href="https://github.com/ultrajson/ultrajson" class="external-link" target="_blank">`ujson`</a> 的可选 JSON 响应。
    
    /// warning | 警告
    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