public final class HttpUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpUtil.ExtensionHeaderNames
Provides the HTTP header extensions used to carry HTTP/2 information in HTTP objects
|
Modifier and Type | Field and Description |
---|---|
static HttpMethod |
OUT_OF_MESSAGE_SEQUENCE_METHOD
This will be the method used for HttpRequest objects generated out of the HTTP message flow defined in
|
static String |
OUT_OF_MESSAGE_SEQUENCE_PATH
This will be the path used for HttpRequest objects generated out of the HTTP message flow defined in
|
static HttpResponseStatus |
OUT_OF_MESSAGE_SEQUENCE_RETURN_CODE
This will be the status code used for HttpResponse objects generated out of the HTTP message flow defined
in
|
Modifier and Type | Method and Description |
---|---|
static void |
addHttp2ToHttpHeaders(int streamId,
Http2Headers sourceHeaders,
FullHttpMessage destinationMessage,
boolean addToTrailer)
Translate and add HTTP/2 headers to HTTP/1.x headers
|
static HttpResponseStatus |
parseStatus(AsciiString status)
Apply HTTP/2 rules while translating status code to
HttpResponseStatus |
static Http2Headers |
toHttp2Headers(FullHttpMessage in)
Converts the given HTTP/1.x headers into HTTP/2 headers.
|
static FullHttpRequest |
toHttpRequest(int streamId,
Http2Headers http2Headers,
boolean validateHttpHeaders)
Create a new object to contain the request data
|
static FullHttpResponse |
toHttpResponse(int streamId,
Http2Headers http2Headers,
boolean validateHttpHeaders)
Create a new object to contain the response data
|
public static final HttpMethod OUT_OF_MESSAGE_SEQUENCE_METHOD
HttpRequest
objects generated out of the HTTP message flow defined in HTTP/2 Spec Message Flowpublic static final String OUT_OF_MESSAGE_SEQUENCE_PATH
HttpRequest
objects generated out of the HTTP message flow defined in HTTP/2 Spec Message Flowpublic static final HttpResponseStatus OUT_OF_MESSAGE_SEQUENCE_RETURN_CODE
HttpResponse
objects generated out of the HTTP message flow defined
in HTTP/2 Spec Message Flowpublic static HttpResponseStatus parseStatus(AsciiString status) throws Http2Exception
HttpResponseStatus
status
- The status from an HTTP/2 frameHttp2Exception
- If there is a problem translating from HTTP/2 to HTTP/1.xpublic static FullHttpResponse toHttpResponse(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders) throws Http2Exception
streamId
- The stream associated with the responsehttp2Headers
- The initial set of HTTP/2 headers to create the response withvalidateHttpHeaders
- true
to validate HTTP headers in the http-codecfalse
not to validate HTTP headers in the http-codecHttp2Exception
- see addHttp2ToHttpHeaders(int, Http2Headers, FullHttpMessage, boolean)
public static FullHttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders) throws Http2Exception
streamId
- The stream associated with the requesthttp2Headers
- The initial set of HTTP/2 headers to create the request withvalidateHttpHeaders
- true
to validate HTTP headers in the http-codecfalse
not to validate HTTP headers in the http-codecHttp2Exception
- see addHttp2ToHttpHeaders(int, Http2Headers, FullHttpMessage, boolean)
public static void addHttp2ToHttpHeaders(int streamId, Http2Headers sourceHeaders, FullHttpMessage destinationMessage, boolean addToTrailer) throws Http2Exception
streamId
- The stream associated with sourceHeaders
sourceHeaders
- The HTTP/2 headers to convertdestinationMessage
- The object which will contain the resulting HTTP/1.x headersaddToTrailer
- true
to add to trailing headers. false
to add to initial headers.Http2Exception
- If not all HTTP/2 headers can be translated to HTTP/1.xpublic static Http2Headers toHttp2Headers(FullHttpMessage in) throws Exception
Exception
Copyright © 2008–2015 The Netty Project. All rights reserved.