java.lang.Object
io.helidon.http.http2.Http2Headers
HTTP/2 headers combining pseudo headers and
Headers
.
HTTP/2 headers are all lower case.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
There is one dynamic table for inbound headers and one for outbound headers for each connection. -
Field Summary
Modifier and TypeFieldDescriptionstatic final HeaderName
Header name of the authority pseudo header.static final HeaderName
Header name of the method pseudo header.static final HeaderName
Header name of the path pseudo header.static final HeaderName
Header name of the scheme pseudo header.static final HeaderName
Header name of the status pseudo header. -
Method Summary
Modifier and TypeMethodDescriptionAuthority pseudo header.Authority of the request.static Http2Headers
Create HTTP/2 headers from HTTP headers.static Http2Headers
create
(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2FrameData... frames) Create headers from HTTP request.static Http2Headers
create
(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Http2FrameData... frames) Create headers from HTTP request.static Http2Headers
create
(WritableHeaders<?> writableHeaders) Create from writable HTTP headers.HTTP headers.method()
Method pseudo header.HTTP method to be used.path()
Path pseudo header.Path of the request.scheme()
Scheme pseudo header.HTTP scheme, such ashttp
orhttps
.status()
Status pseudo header.Status pseudo header.toString()
void
Validate client or server request.void
Validate server response or client response.void
write
(Http2Headers.DynamicTable table, Http2HuffmanEncoder huffman, BufferData growingBuffer) Write headers to a buffer.
-
Field Details
-
AUTHORITY_NAME
Header name of the authority pseudo header. -
METHOD_NAME
Header name of the method pseudo header. -
PATH_NAME
Header name of the path pseudo header. -
SCHEME_NAME
Header name of the scheme pseudo header. -
STATUS_NAME
Header name of the status pseudo header.
-
-
Method Details
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2Headers headers, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream
- stream that owns these headerstable
- dynamic table for this connectionhuffman
- huffman decoderheaders
- http2 headersframes
- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception
- in case of protocol errors
-
create
public static Http2Headers create(Http2Stream stream, Http2Headers.DynamicTable table, Http2HuffmanDecoder huffman, Http2FrameData... frames) Create headers from HTTP request.- Parameters:
stream
- stream that owns these headerstable
- dynamic table for this connectionhuffman
- huffman decoderframes
- frames of the headers- Returns:
- new headers parsed from the frames
- Throws:
Http2Exception
- in case of protocol errors
-
create
Create HTTP/2 headers from HTTP headers.- Parameters:
headers
- headers to base these headers on- Returns:
- new HTTP/2 headers
-
create
Create from writable HTTP headers.- Parameters:
writableHeaders
- header to use- Returns:
- new HTTP/2 headers
-
status
Status pseudo header.- Returns:
- status or null if none defined
-
path
Path pseudo header.- Returns:
- path or null if none defined
-
method
Method pseudo header.- Returns:
- method or null if none defined
-
scheme
Scheme pseudo header.- Returns:
- method or null if none defined
-
authority
Authority pseudo header.- Returns:
- authority or null if none defined
-
path
Path of the request.- Parameters:
path
- HTTP path of the request- Returns:
- updated headers
-
method
HTTP method to be used.- Parameters:
method
- HTTP method of the request- Returns:
- updated headers
-
authority
Authority of the request. This is an HTTP/2 pseudo-header. This is an equivalent ofHOST
header in HTTP/1.- Parameters:
authority
- authority of the request, such aslocalhost:8080
- Returns:
- updated headers
-
scheme
HTTP scheme, such ashttp
orhttps
.- Parameters:
scheme
- scheme of the request- Returns:
- updated headeres
-
httpHeaders
HTTP headers.- Returns:
- headers
-
validateResponse
Validate server response or client response.- Throws:
Http2Exception
- in case the response is invalid
-
validateRequest
Validate client or server request.- Throws:
Http2Exception
- in case the request is invalid
-
toString
-
status
Status pseudo header.- Parameters:
status
- status to use- Returns:
- updated headers
-
write
public void write(Http2Headers.DynamicTable table, Http2HuffmanEncoder huffman, BufferData growingBuffer) Write headers to a buffer.- Parameters:
table
- dynamic table to usehuffman
- huffman encoder to usegrowingBuffer
- buffer to write to
-