- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 123 for gzip (0.12 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/en/docs/advanced/middleware.md
## `GZipMiddleware` { #gzipmiddleware } Handles GZip responses for any request that includes `"gzip"` in the `Accept-Encoding` header. The middleware will handle both standard and streaming responses. {* ../../docs_src/advanced_middleware/tutorial003_py310.py hl[2,6] *} The following arguments are supported: * `minimum_size` - Do not GZip responses that are smaller than this minimum size in bytes. Defaults to `500`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.1K bytes - Click Count (0) -
docs_src/custom_request_and_route/tutorial001_py310.py
import gzip from collections.abc import Callable from fastapi import Body, FastAPI, Request, Response from fastapi.routing import APIRoute class GzipRequest(Request): async def body(self) -> bytes: if not hasattr(self, "_body"): body = await super().body() if "gzip" in self.headers.getlist("Content-Encoding"): body = gzip.decompress(body) self._body = body
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 976 bytes - Click Count (0) -
docs_src/custom_request_and_route/tutorial001_an_py310.py
import gzip from collections.abc import Callable from typing import Annotated from fastapi import Body, FastAPI, Request, Response from fastapi.routing import APIRoute class GzipRequest(Request): async def body(self) -> bytes: if not hasattr(self, "_body"): body = await super().body() if "gzip" in self.headers.getlist("Content-Encoding"): body = gzip.decompress(body)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 10 08:55:32 GMT 2025 - 1015 bytes - Click Count (0) -
docs/en/docs/how-to/custom-request-and-route.md
* Converting non-JSON request bodies to JSON (e.g. [`msgpack`](https://msgpack.org/index.html)). * Decompressing gzip-compressed request bodies. * Automatically logging all request bodies. ## Handling custom request body encodings { #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.
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/RequestTest.kt
.post("This is the original message".toRequestBody()) .gzip() .gzip() .build() }.also { assertThat(it).hasMessage("Content-Encoding already set: gzip") } } @Test fun curlGet() { val request = Request .Builder() .url("https://example.com") .header("Authorization", "Bearer abc123") .build()
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 24.6K bytes - Click Count (0) -
docs/ja/docs/advanced/middleware.md
## `GZipMiddleware` { #gzipmiddleware } `Accept-Encoding` ヘッダーに "gzip" を含むリクエストに対して GZip レスポンスを処理します。 このミドルウェアは、通常のレスポンスとストリーミングレスポンスの両方を処理します。 {* ../../docs_src/advanced_middleware/tutorial003_py310.py hl[2,6] *} サポートされる引数は次のとおりです: - `minimum_size` - このバイト数の最小サイズ未満のレスポンスは GZip 圧縮しません。デフォルトは `500` です。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:07:17 GMT 2026 - 5.2K bytes - Click Count (0) -
okhttp-zstd/README.md
This module enables [Zstandard (zstd)][1] response compression in addition to Gzip, as long as the `Accept-Encoding` header is not otherwise set. Web servers must be configured to return zstd responses. Note that zstd is not used for sending requests. ```java OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(CompressionInterceptor(Zstd, Gzip)) .build(); ``` ```kotlin
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Mar 11 05:41:23 GMT 2026 - 566 bytes - Click Count (1) -
docs/zh-hant/docs/how-to/custom-request-and-route.md
可能的使用情境包括: * 將非 JSON 的請求本文轉換為 JSON(例如 [`msgpack`](https://msgpack.org/index.html))。 * 解壓縮以 gzip 壓縮的請求本文。 * 自動記錄所有請求本文。 ## 處理自訂請求本文編碼 { #handling-custom-request-body-encodings } 讓我們看看如何使用自訂的 `Request` 子類別來解壓縮 gzip 請求。 並透過 `APIRoute` 子類別來使用該自訂的請求類別。 ### 建立自訂的 `GzipRequest` 類別 { #create-a-custom-gziprequest-class } /// tip 這是一個示範用的簡化範例;如果你需要 Gzip 支援,可以直接使用提供的 [`GzipMiddleware`](../advanced/middleware.md#gzipmiddleware)。 ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 4.2K bytes - Click Count (0) -
docs/zh-hant/docs/advanced/middleware.md
若傳入請求驗證失敗,將回傳 `400` 回應。 ## `GZipMiddleware` { #gzipmiddleware } 處理在 `Accept-Encoding` 標頭中包含 `"gzip"` 的請求之 GZip 壓縮回應。 此中介軟體會處理一般與串流回應。 {* ../../docs_src/advanced_middleware/tutorial003_py310.py hl[2,6] *} 支援以下參數: - `minimum_size` - 小於此位元組大小的回應不會進行 GZip。預設為 `500`。 - `compresslevel` - GZip 壓縮時使用的等級。為 1 到 9 的整數。預設為 `9`。值越小壓縮越快但檔案較大,值越大壓縮較慢但檔案較小。 ## 其他中介軟體 { #other-middlewares } 還有許多其他 ASGI 中介軟體。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 3.9K bytes - Click Count (0) -
docs/zh/docs/advanced/middleware.md
如果传入的请求没有通过验证,则发送 `400` 响应。 ## `GZipMiddleware` { #gzipmiddleware } 处理 `Accept-Encoding` 请求头中包含 `"gzip"` 请求的 GZip 响应。 中间件会处理标准响应与流响应。 {* ../../docs_src/advanced_middleware/tutorial003_py310.py hl[2,6] *} 支持以下参数: * `minimum_size` - 小于该最小字节数的响应不使用 GZip。默认值是 `500`。 * `compresslevel` - GZip 压缩使用的级别,为 1 到 9 的整数。默认为 `9`。值越低压缩越快但文件更大,值越高压缩越慢但文件更小。 ## 其它中间件 { #other-middlewares }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 3.7K bytes - Click Count (0)