public class HttpRequest extends HttpMsg
getHeader(String) to get the appropriate field.| Modifier and Type | Field and Description |
|---|---|
int |
contentLength |
int |
contentOffset |
static byte |
CR |
int |
iread
The read cursor, used in the read* methods.
|
java.lang.String[] |
keys
Keys present in the HTTP header
|
static byte |
LF |
java.lang.String |
method
The original header.
|
int |
nFields |
int |
queryStringRange |
int |
uriFragmentRange |
java.lang.String |
uriPath
The UTF8 decoded path from the HTTP header.
|
int[] |
valueRanges |
int |
versionRange |
| Constructor and Description |
|---|
HttpRequest() |
| Modifier and Type | Method and Description |
|---|---|
void |
addField(java.lang.String key,
int valRange) |
void |
dumpBuffer(java.nio.ByteBuffer buffer) |
byte[] |
extractBytes(int beg,
int end) |
java.lang.String |
extractRange(int range) |
java.lang.String |
extractRange(int beg,
int end) |
void |
fill(EndPoint endpoint,
int offset,
int size) |
java.lang.String |
getHeader(java.lang.String key)
Get the value for a given key
|
java.lang.String |
getQuery() |
KeyValues |
getQueryComponents() |
KeyValues |
getQueryComponents(java.lang.String q) |
boolean |
isOldHttp() |
boolean |
keepAlive() |
static int |
parseChunkSize(java.nio.ByteBuffer buffer,
int start,
int end) |
void |
readAllChunks(EndPoint endpoint) |
void |
readBody(EndPoint endpoint) |
void |
readFrom(EndPoint endpoint) |
void |
readHeader(EndPoint endpoint) |
int |
readLine(EndPoint endpoint) |
void |
readTrailers(EndPoint endpoint) |
void |
reuse()
Clear the request object so that it can be reused for the next message.
|
java.lang.String |
toString() |
java.lang.String |
uriFragment() |
java.lang.String |
version() |
public java.lang.String method
public java.lang.String uriPath
public int nFields
public java.lang.String[] keys
public int versionRange
public int uriFragmentRange
public int queryStringRange
public int[] valueRanges
public int contentOffset
public int contentLength
public int iread
public static byte CR
public static byte LF
public java.lang.String getHeader(java.lang.String key)
key - public java.lang.String getQuery()
public java.lang.String version()
public boolean keepAlive()
public KeyValues getQueryComponents()
public KeyValues getQueryComponents(java.lang.String q)
public java.lang.String uriFragment()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isOldHttp()
public void reuse()
public void readFrom(EndPoint endpoint) throws Pausable, java.io.IOException
Pausablejava.io.IOExceptionpublic void readHeader(EndPoint endpoint) throws Pausable, java.io.IOException
Pausablejava.io.IOExceptionpublic void dumpBuffer(java.nio.ByteBuffer buffer)
public void addField(java.lang.String key,
int valRange)
public java.lang.String extractRange(int range)
public java.lang.String extractRange(int beg,
int end)
public byte[] extractBytes(int beg,
int end)
public void readBody(EndPoint endpoint) throws Pausable, java.io.IOException
Pausablejava.io.IOExceptionpublic void readTrailers(EndPoint endpoint)
public void readAllChunks(EndPoint endpoint) throws java.io.IOException, Pausable
java.io.IOExceptionPausablepublic static int parseChunkSize(java.nio.ByteBuffer buffer,
int start,
int end)
throws java.io.IOException
java.io.IOExceptionpublic void fill(EndPoint endpoint, int offset, int size) throws java.io.IOException, Pausable
java.io.IOExceptionPausable