Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for encoding (0.23 sec)

  1. docs/en/docs/advanced/middleware.md

    ## `HTTPSRedirectMiddleware`
    
    Enforces that all incoming requests must either be `https` or `wss`.
    
    Any incoming requests to `http` or `ws` will be redirected to the secure scheme instead.
    
    ```Python hl_lines="2  6"
    {!../../../docs_src/advanced_middleware/tutorial001.py!}
    ```
    
    ## `TrustedHostMiddleware`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_advanced_middleware/test_tutorial003.py

    
    client = TestClient(app)
    
    
    def test_middleware():
        response = client.get("/large", headers={"accept-encoding": "gzip"})
        assert response.status_code == 200, response.text
        assert response.text == "x" * 4000
        assert response.headers["Content-Encoding"] == "gzip"
        assert int(response.headers["Content-Length"]) < 4000
        response = client.get("/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 665 bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/response-model.md

        ```
    
    This will make FastAPI skip the response model generation and that way you can have any return type annotations you need without it affecting your FastAPI application. 🤓
    
    ## Response Model encoding parameters
    
    Your response model could have default values, like:
    
    === "Python 3.10+"
    
        ```Python hl_lines="9  11-12"
        {!> ../../../docs_src/response_model/tutorial004_py310.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  4. .github/actions/people/app/main.py

        people_path = Path("./docs/en/data/people.yml")
        github_sponsors_path = Path("./docs/en/data/github_sponsors.yml")
        people_old_content = people_path.read_text(encoding="utf-8")
        github_sponsors_old_content = github_sponsors_path.read_text(encoding="utf-8")
        new_people_content = yaml.dump(
            people, sort_keys=False, width=200, allow_unicode=True
        )
        new_github_sponsors_content = yaml.dump(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  5. docs/ja/docs/tutorial/extra-data-types.md

        * Pythonの`datetime.time`.
        * リクエストとレスポンスはISO 8601形式の`str`で表現されます: `14:23:55.003`
    * `datetime.timedelta`:
        * Pythonの`datetime.timedelta`です。
        * リクエストとレスポンスでは合計秒数の`float`で表現されます。
        * Pydanticでは「ISO 8601 time diff encoding」として表現することも可能です。<a href="https://docs.pydantic.dev/latest/concepts/serialization/" class="external-link" target="_blank">詳細はドキュメントを参照してください</a>。
    * `frozenset`:
        * リクエストとレスポンスでは`set`と同じように扱われます:
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  6. docs/en/docs/alternatives.md

    Another big feature needed by APIs is data validation, making sure that the data is valid, given certain parameters. For example, that some field is an `int`, and not some random string. This is especially useful for incoming data.
    
    Without a data validation system, you would have to do all the checks by hand, in code.
    
    These features are what Marshmallow was built to provide. It is a great library, and I have used it a lot before.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  7. docs/en/docs/release-notes.md

    ## 0.110.2
    
    ### Fixes
    
    * 🐛 Fix support for query parameters with list types, handle JSON encoding Pydantic `UndefinedType`. PR [#9929](https://github.com/tiangolo/fastapi/pull/9929) by [@arjwilliams](https://github.com/arjwilliams).
    
    ### Refactors
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  8. tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py

    def test_gzip_request(compress):
        n = 1000
        headers = {}
        body = [1] * n
        data = json.dumps(body).encode()
        if compress:
            data = gzip.compress(data)
            headers["Content-Encoding"] = "gzip"
        headers["Content-Type"] = "application/json"
        response = client.post("/sum", content=data, headers=headers)
        assert response.json() == {"sum": n}
    
    
    def test_request_class():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 886 bytes
    - Viewed (0)
  9. docs/en/docs/how-to/custom-request-and-route.md

    * Decompressing gzip-compressed request bodies.
    * Automatically logging all request bodies.
    
    ## Handling custom request body encodings
    
    Let's see how to make use of a custom `Request` subclass to decompress gzip requests.
    
    And an `APIRoute` subclass to use that custom request class.
    
    ### Create a custom `GzipRequest` class
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  10. fastapi/openapi/models.py

        schema_: Optional[Union[Schema, Reference]] = Field(default=None, alias="schema")
        example: Optional[Any] = None
        examples: Optional[Dict[str, Union[Example, Reference]]] = None
        encoding: Optional[Dict[str, Encoding]] = None
    
    
    class ParameterBase(BaseModelWithConfig):
        description: Optional[str] = None
        required: Optional[bool] = None
        deprecated: Optional[bool] = None
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 22:49:33 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top