public class HttpEncodingService extends SimpleDecoratingHttpService
HttpService to apply HTTP encoding (e.g., gzip) to an HttpService.
HTTP encoding will be applied if:
| Constructor and Description |
|---|
HttpEncodingService(HttpService delegate)
Creates a new
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. |
HttpEncodingService(HttpService delegate,
Predicate<MediaType> encodableContentTypePredicate,
int minBytesToForceChunkedAndEncoding)
Creates a new
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. |
HttpEncodingService(HttpService delegate,
Predicate<MediaType> encodableContentTypePredicate,
Predicate<HttpHeaders> encodableRequestHeadersPredicate,
long minBytesToForceChunkedAndEncoding)
Creates a new
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
serve(ServiceRequestContext ctx,
HttpRequest req)
Serves an incoming
Request. |
serviceAdded, shouldCachePathas, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdecorate, decorateas, decorate, serviceAdded, shouldCachePathpublic HttpEncodingService(HttpService delegate)
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. Encoding will be applied when the client supports it, the response content type
is a common web text format, and the response either has variable content length or a length greater
than 1024.public HttpEncodingService(HttpService delegate, Predicate<MediaType> encodableContentTypePredicate, int minBytesToForceChunkedAndEncoding)
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. Encoding will be applied when the client supports it, the response content type
passes the supplied encodableContentTypePredicate and the response either has variable
content length or a length greater than minBytesToForceChunkedAndEncoding.public HttpEncodingService(HttpService delegate, Predicate<MediaType> encodableContentTypePredicate, Predicate<HttpHeaders> encodableRequestHeadersPredicate, long minBytesToForceChunkedAndEncoding)
SimpleDecoratingHttpService that HTTP-encodes the response data published from
delegate. Encoding will be applied when the client supports it, the response content type
passes the supplied encodableContentTypePredicate, the request headers passes the supplied
encodableRequestHeadersPredicate and the response either has variable content length or a length
greater than minBytesToForceChunkedAndEncoding.public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception
ServiceRequest.Copyright © 2020 LeanCloud. All rights reserved.