public class HttpRequest extends HttpMessage
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpRequest.Method
Representation of the various HTTP methods.
|
HttpMessage.BodyEMPTY_BODY, NO_BODY| Constructor and Description |
|---|
HttpRequest(HttpRequest.Method method,
URI uri,
String httpVersion) |
HttpRequest(HttpRequest.Method method,
URI uri,
String httpVersion,
InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String name,
String value)
Adds another parameter.
|
void |
addParameter(String name,
String[] values)
Adds a multi-value parameter.
|
String |
getHttpVersion() |
HttpRequest.Method |
getMethod() |
String[] |
getParameter(String name) |
List<Map.Entry<String,String>> |
getParameterList() |
URI |
getUri() |
static HttpRequest |
read(InputStream in)
Parses and returns one HTTP request from the given
InputStream. |
static void |
read(ReadableByteChannel in,
Multiplexer multiplexer,
ConsumerWhichThrows<HttpRequest,IOException> requestConsumer)
Reads one HTTP request from
in through the multiplexer and passes it to the requestConsumer. |
void |
setHttpVersion(String httpVersion)
Changes the HTTP version of this request.
|
void |
setMethod(HttpRequest.Method method)
Changes the HTTP method of this request.
|
void |
setParameter(String name,
String value)
Removes all parameters with the given name and adds another parameter.
|
void |
setParameter(String name,
String[] values)
Removes all parameters with the given name and adds another multi-value parameter.
|
void |
setParameterList(Iterable<Map.Entry<String,String>> parameters)
Changes this HTTP request's parameters.
|
void |
setUri(URI uri)
Changes the URI of this HTTP request.
|
void |
write(OutputStream out)
Writes this HTTP request to the given
OutputStream. |
addHeader, addHeader, addHeader, addHeader, body, body, body, body, getCharset, getDateHeader, getHeader, getHeaders, getHeaders, getIntHeader, getLongHeader, readBody, readHeaders, readLine, readLine, removeBody, removeHeader, setBody, setHeader, setHeader, setHeader, setHeader, writeHeadersAndBodypublic HttpRequest(HttpRequest.Method method, URI uri, String httpVersion, InputStream in) throws IOException
IOExceptionpublic HttpRequest(HttpRequest.Method method, URI uri, String httpVersion)
public static HttpRequest read(InputStream in) throws IOException, InvalidHttpMessageException
InputStream.public HttpRequest.Method getMethod()
HttpRequest.Methodpublic String getHttpVersion()
public URI getUri()
public final void setUri(URI uri)
public List<Map.Entry<String,String>> getParameterList() throws IOException
IOExceptionpublic void setParameterList(Iterable<Map.Entry<String,String>> parameters)
@Nullable public String[] getParameter(String name) throws IOException
nameIOExceptionpublic void addParameter(String name, String value) throws IOException
IOExceptionpublic void addParameter(String name, String[] values) throws IOException
IOExceptionpublic void setParameter(String name, String value) throws IOException
IOExceptionpublic void setParameter(String name, String[] values) throws IOException
IOExceptionpublic void setMethod(HttpRequest.Method method)
public void setHttpVersion(String httpVersion)
public void write(OutputStream out) throws IOException
OutputStream.IOExceptionpublic static void read(ReadableByteChannel in, Multiplexer multiplexer, ConsumerWhichThrows<HttpRequest,IOException> requestConsumer) throws IOException
in through the multiplexer and passes it to the requestConsumer.IOExceptionCopyright © 2016 Arno Unkrig. All rights reserved.