- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 164 for GZIP (0.02 seconds)
-
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) -
okhttp-zstd/src/test/java/okhttp3/zstd/ZstdInterceptorTest.kt
import okio.ByteString.Companion.EMPTY import okio.ByteString.Companion.encodeUtf8 import okio.Sink import okio.buffer import okio.gzip import org.junit.jupiter.api.Test class ZstdInterceptorTest { val zstdInterceptor = CompressionInterceptor(Zstd, Gzip) @Test fun testDecompressZstd() { val s = "hello zstd world".encodeUtf8().zstdCompress() val response = response("https://example.com/", s) {Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Fri Aug 01 06:04:22 GMT 2025 - 4.8K bytes - Click Count (1) -
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) -
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) -
internal/http/response-recorder.go
// gzippedBody returns a dummy body placeholder for gzipped content var gzippedBody = []byte("<GZIP>") // Body - Return response body. func (lrw *ResponseRecorder) Body() []byte { if lrw.Header().Get("Content-Encoding") == "gzip" { if lrw.body.Len() > 1<<20 { return gzippedBody } r, err := gzip.NewReader(&lrw.body) if err != nil { return gzippedBody } defer r.Close()Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Mar 30 00:56:02 GMT 2025 - 5.5K 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) -
docs/select/README.md
- UTF-8 is the only encoding type the Select API supports. - GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP, BZIP2, [ZSTD](https://facebook.github.io/zstd/), and streaming formats of [LZ4](https://lz4.github.io/lz4/), [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) and [SNAPPY](http://google.github.io/snappy/).
Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Tue Aug 12 18:20:36 GMT 2025 - 6.6K bytes - Click Count (0) -
docs/features/interceptors.md
} Request compressedRequest = originalRequest.newBuilder() .header("Content-Encoding", "gzip") .method(originalRequest.method(), gzip(originalRequest.body())) .build(); return chain.proceed(compressedRequest); } private RequestBody gzip(final RequestBody body) { return new RequestBody() { @Override public MediaType contentType() {Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Feb 06 02:19:09 GMT 2022 - 8.1K 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) -
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)