|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.net.http.HttpMessage
de.unkrig.commons.net.http.HttpRequest
public class HttpRequest
Representation of an HTTP request.
| Nested Class Summary | |
|---|---|
static class |
HttpRequest.Method
Representation of the various HTTP methods. |
| Nested classes/interfaces inherited from class de.unkrig.commons.net.http.HttpMessage |
|---|
HttpMessage.Body |
| Field Summary |
|---|
| Fields inherited from class de.unkrig.commons.net.http.HttpMessage |
|---|
EMPTY_BODY, NO_BODY |
| Constructor Summary | |
|---|---|
HttpRequest(HttpRequest.Method method,
java.net.URI uri,
java.lang.String httpVersion)
|
|
HttpRequest(HttpRequest.Method method,
java.net.URI uri,
java.lang.String httpVersion,
java.io.InputStream in)
|
|
| Method Summary | |
|---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Adds another parameter. |
void |
addParameter(java.lang.String name,
java.lang.String[] values)
Adds a multi-value parameter. |
java.lang.String |
getHttpVersion()
|
HttpRequest.Method |
getMethod()
|
java.lang.String[] |
getParameter(java.lang.String name)
|
java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getParameterList()
|
java.net.URI |
getUri()
|
static HttpRequest |
read(java.io.InputStream in)
Parses and returns one HTTP request from the given InputStream. |
static void |
read(java.nio.channels.ReadableByteChannel in,
Multiplexer multiplexer,
ConsumerWhichThrows<HttpRequest,java.io.IOException> requestConsumer)
Reads one HTTP request from in through the multiplexer and passes it to the requestConsumer. |
void |
setHttpVersion(java.lang.String httpVersion)
Changes the HTTP version of this request. |
void |
setMethod(HttpRequest.Method method)
Changes the HTTP method of this request. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Removes all parameters with the given name and adds another parameter. |
void |
setParameter(java.lang.String name,
java.lang.String[] values)
Removes all parameters with the given name and adds another multi-value parameter. |
void |
setParameterList(java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> parameters)
Changes this HTTP request's parameters. |
void |
setUri(java.net.URI uri)
Changes the URI of this HTTP request. |
void |
write(java.io.OutputStream out)
Writes this HTTP request to the given OutputStream. |
| Methods inherited from class de.unkrig.commons.net.http.HttpMessage |
|---|
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, writeHeadersAndBody |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpRequest(HttpRequest.Method method,
java.net.URI uri,
java.lang.String httpVersion,
java.io.InputStream in)
throws java.io.IOException
java.io.IOException
public HttpRequest(HttpRequest.Method method,
java.net.URI uri,
java.lang.String httpVersion)
| Method Detail |
|---|
public static HttpRequest read(java.io.InputStream in)
throws java.io.IOException,
InvalidHttpMessageException
InputStream.
java.io.IOException
InvalidHttpMessageExceptionpublic HttpRequest.Method getMethod()
HttpRequest.Methodpublic java.lang.String getHttpVersion()
public java.net.URI getUri()
public final void setUri(java.net.URI uri)
public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> getParameterList()
throws java.io.IOException
java.io.IOExceptionpublic void setParameterList(java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> parameters)
@Nullable
public java.lang.String[] getParameter(java.lang.String name)
throws java.io.IOException
name
java.io.IOException
public void addParameter(java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public void addParameter(java.lang.String name,
java.lang.String[] values)
throws java.io.IOException
java.io.IOException
public void setParameter(java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOException
public void setParameter(java.lang.String name,
java.lang.String[] values)
throws java.io.IOException
java.io.IOExceptionpublic void setMethod(HttpRequest.Method method)
public void setHttpVersion(java.lang.String httpVersion)
public void write(java.io.OutputStream out)
throws java.io.IOException
OutputStream.
java.io.IOException
public static void read(java.nio.channels.ReadableByteChannel in,
Multiplexer multiplexer,
ConsumerWhichThrows<HttpRequest,java.io.IOException> requestConsumer)
throws java.io.IOException
in through the multiplexer and passes it to the requestConsumer.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||