1
0
mirror of https://github.com/actix/actix-website synced 2025-06-29 08:14:58 +02:00

fix chunked example

This commit is contained in:
Nikolay Kim
2020-01-02 18:36:32 +06:00
parent b8e2a2310c
commit 4fffc16668
3 changed files with 3 additions and 16 deletions

View File

@ -71,16 +71,5 @@ The type `T` must implement the `Serialize` trait from *serde*.
{{< include-example example="responses" file="json_resp.rs" section="json-resp" >}}
# Chunked transfer encoding
Chunked encoding on a response can be enabled with `HttpResponseBuilder::chunked()`.
This takes effect only for `Body::Streaming(BodyStream)` or `Body::StreamingContext` bodies.
If the response payload compression is enabled and a streaming body is used, chunked encoding
is enabled automatically.
> Enabling chunked encoding for *HTTP/2.0* responses is forbidden.
{{< include-example example="responses" file="chunked.rs" section="chunked" >}}
[responsebuilder]: https://docs.rs/actix-web/2/actix_web/dev/struct.HttpResponseBuilder.html
[compressmidddleware]: https://docs.rs/actix-web/2/actix_web/middleware/struct.Compress.html