Class HttpRequestEncoder
java.lang.Object
org.jdrupes.httpcodec.protocols.http.HttpCodec<T>
org.jdrupes.httpcodec.protocols.http.HttpEncoder<HttpRequest,HttpResponse>
org.jdrupes.httpcodec.protocols.http.client.HttpRequestEncoder
- All Implemented Interfaces:
Codec
,Encoder<HttpRequest,
HttpResponse>
An encoder for HTTP requests.
It accepts a header and optional
payload data and encodes it into a sequence of Buffer
s.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Results fromHttpRequestEncoder
add no additional information toHttpEncoder.Result
.Nested classes/interfaces inherited from interface org.jdrupes.httpcodec.Codec
Codec.ProtocolSwitchResult
-
Field Summary
Fields inherited from class org.jdrupes.httpcodec.protocols.http.HttpEncoder
peerDecoder
Fields inherited from class org.jdrupes.httpcodec.protocols.http.HttpCodec
messageHeader
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(HttpRequest messageHeader) Set a new HTTP message that is to be encoded.encoding()
Returns the type of the messages encoded by this encoder.protected HttpRequestEncoder.Result.Factory
Returns the result factory for this codec.protected void
startMessage
(HttpRequest messageHeader, Writer writer) Writes the request line.Methods inherited from class org.jdrupes.httpcodec.protocols.http.HttpEncoder
encode, forceCloseAfterBody, header, isClosed, pendingLimit, setPeerDecoder, setPendingLimit
Methods inherited from class org.jdrupes.httpcodec.protocols.http.HttpCodec
bodyCharset
-
Constructor Details
-
HttpRequestEncoder
public HttpRequestEncoder()
-
-
Method Details
-
encoding
Description copied from interface:Encoder
Returns the type of the messages encoded by this encoder.- Returns:
- the value
-
resultFactory
Description copied from class:HttpEncoder
Returns the result factory for this codec.- Specified by:
resultFactory
in classHttpEncoder<HttpRequest,
HttpResponse> - Returns:
- the factory
-
encode
Description copied from class:HttpEncoder
Set a new HTTP message that is to be encoded.- Specified by:
encode
in interfaceEncoder<HttpRequest,
HttpResponse> - Overrides:
encode
in classHttpEncoder<HttpRequest,
HttpResponse> - Parameters:
messageHeader
- the response
-
startMessage
Writes the request line.- Specified by:
startMessage
in classHttpEncoder<HttpRequest,
HttpResponse> - Parameters:
messageHeader
- the message header to encode (seeHttpEncoder.encode(HttpMessageHeader)
writer
- the Writer to use for writing- Throws:
IOException
- if an I/O error occurs
-