Package org.microproxy.http
Class DefaultHttpRequest
java.lang.Object
org.microproxy.http.DefaultHttpRequest
- All Implemented Interfaces:
HttpMessage,HttpObject,HttpRequest
- Direct Known Subclasses:
DefaultFullHttpRequest
Mutable
HttpRequest head.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpRequest(HttpVersion version, HttpMethod method, String uri) Creates a request with empty headers.DefaultHttpRequest(HttpVersion version, HttpMethod method, String uri, HttpHeaders headers) Creates a request head using the supplied headers. -
Method Summary
Modifier and TypeMethodDescriptionheaders()Returns the mutable header fields of this message.method()Returns the request method.Returns the message's protocol version.setMethod(HttpMethod method) Changes the request method.setProtocolVersion(HttpVersion version) Changes the message's protocol version.Changes the request-target.toString()uri()Returns the request-target exactly as it appears on the request line.
-
Constructor Details
-
DefaultHttpRequest
Creates a request with empty headers.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control characters
-
DefaultHttpRequest
Creates a request head using the supplied headers.- Parameters:
version- protocol versionmethod- request methoduri- request-target, without whitespace or control charactersheaders- mutable headers, retained without copying
-
-
Method Details
-
protocolVersion
Description copied from interface:HttpMessageReturns the message's protocol version.- Specified by:
protocolVersionin interfaceHttpMessage- Returns:
- the message's protocol version
-
setProtocolVersion
Description copied from interface:HttpMessageChanges the message's protocol version.- Specified by:
setProtocolVersionin interfaceHttpMessage- Specified by:
setProtocolVersionin interfaceHttpRequest- Parameters:
version- new protocol version- Returns:
- this message
-
headers
Description copied from interface:HttpMessageReturns the mutable header fields of this message.- Specified by:
headersin interfaceHttpMessage- Returns:
- the mutable header fields of this message
-
method
Description copied from interface:HttpRequestReturns the request method.- Specified by:
methodin interfaceHttpRequest- Returns:
- the request method
-
setMethod
Description copied from interface:HttpRequestChanges the request method.- Specified by:
setMethodin interfaceHttpRequest- Parameters:
method- new request method- Returns:
- this request
-
uri
Description copied from interface:HttpRequestReturns the request-target exactly as it appears on the request line.- Specified by:
uriin interfaceHttpRequest- Returns:
- the request-target exactly as it appears on the request line
-
setUri
Description copied from interface:HttpRequestChanges the request-target.- Specified by:
setUriin interfaceHttpRequest- Parameters:
uri- new request-target, without whitespace or control characters- Returns:
- this request
-
toString
-