Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 85 for GZIP (0.38 seconds)

  1. 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)
  2. 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)
  3. 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)
  4. docs/ko/docs/how-to/custom-request-and-route.md

    * 모든 요청 바디를 자동으로 로깅하기.
    
    ## 커스텀 요청 바디 인코딩 처리하기 { #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 14:06:26 GMT 2026
    - 5.2K bytes
    - Click Count (0)
  5. okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt

                .gzip()
                .build(),
            ).execute()
        val responseBody = response.body
        assertThat(responseBody.string(), "Expected response body to be valid")
          .isEqualTo("Uncompressed")
        responseBody.close()
        networkLogs
          .assertLogEqual("--> POST $url http/1.1")
          .assertLogEqual("Content-Encoding: gzip")
          .assertLogEqual("Transfer-Encoding: chunked")
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Fri Nov 07 02:57:33 GMT 2025
    - 39.4K bytes
    - Click Count (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to Top