Package org.microproxy.http
Class DefaultFullHttpRequest
java.lang.Object
org.microproxy.http.DefaultHttpRequest
org.microproxy.http.DefaultFullHttpRequest
- All Implemented Interfaces:
FullHttpMessage,FullHttpRequest,HttpContent,HttpMessage,HttpObject,HttpRequest,LastHttpContent
public non-sealed class DefaultFullHttpRequest
extends DefaultHttpRequest
implements FullHttpRequest
A complete request with its body.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFullHttpRequest(HttpVersion version, HttpMethod method, String uri) Creates a complete request with empty headers and an empty body.DefaultFullHttpRequest(HttpVersion version, HttpMethod method, String uri, byte[] content) Creates a complete request with empty headers.DefaultFullHttpRequest(HttpVersion version, HttpMethod method, String uri, String body) Creates a complete request with a UTF-8 body and empty headers.DefaultFullHttpRequest(HttpVersion version, HttpMethod method, String uri, HttpHeaders headers, byte[] content) Creates a complete request using the supplied headers and body. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]content()Returns the live backing array of body bytes, not a copy.setContent(byte[] content) Replaces the body bytes of this piece.setProtocolVersion(HttpVersion version) Changes the message's protocol version.Returns the mutable trailer fields following the body.Methods inherited from class org.microproxy.http.DefaultHttpRequest
headers, method, protocolVersion, setMethod, setUri, toString, uriMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microproxy.http.HttpContent
contentAsString, contentAsString, contentLengthMethods inherited from interface org.microproxy.http.HttpMessage
headers, protocolVersionMethods inherited from interface org.microproxy.http.HttpRequest
method, setMethod, setUri, uri
-
Constructor Details
-
DefaultFullHttpRequest
Creates a complete request with empty headers and an empty body.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control characters
-
DefaultFullHttpRequest
Creates a complete request with empty headers.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control characterscontent- body backing array, retained without copying
-
DefaultFullHttpRequest
public DefaultFullHttpRequest(HttpVersion version, HttpMethod method, String uri, HttpHeaders headers, byte[] content) Creates a complete request using the supplied headers and body.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control charactersheaders- mutable headers, retained without copyingcontent- body backing array, retained without copying
-
DefaultFullHttpRequest
Creates a complete request with a UTF-8 body and empty headers.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control charactersbody- body text to encode as UTF-8
-
-
Method Details
-
content
public byte[] content()Description copied from interface:HttpContentReturns the live backing array of body bytes, not a copy.- Specified by:
contentin interfaceHttpContent- Returns:
- the live backing array of body bytes, not a copy
-
setContent
Description copied from interface:HttpContentReplaces the body bytes of this piece.- Specified by:
setContentin interfaceFullHttpMessage- Specified by:
setContentin interfaceFullHttpRequest- Specified by:
setContentin interfaceHttpContent- Specified by:
setContentin interfaceLastHttpContent- Parameters:
content- new backing array, retained without copying- Returns:
- this content object
-
trailingHeaders
Description copied from interface:LastHttpContentReturns the mutable trailer fields following the body.- Specified by:
trailingHeadersin interfaceLastHttpContent- Returns:
- the mutable trailer fields following the body
-
setProtocolVersion
Description copied from interface:HttpMessageChanges the message's protocol version.- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpRequest- Overrides:
setProtocolVersionin classDefaultHttpRequest- Parameters:
version- new protocol version- Returns:
- this message
-