public static class HttpServer.Request extends Object
Constructor and Description |
---|
Request(String method,
String url,
Map headerMap,
SocketAddress remoteAddress,
byte[] body)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBody()
Returns the body of the HTTP request if there was one.
|
Map |
getHeaderMap()
Returns a map of key-value pairs representing HTTP request headers.
|
String |
getMethod()
Returns the request method string.
|
SocketAddress |
getRemoteAddress()
Returns the address of the client which made this request.
|
String |
getUrl()
Returns the request URL string.
|
String |
toString() |
public Request(String method, String url, Map headerMap, SocketAddress remoteAddress, byte[] body)
method
- HTTP method string (GET, HEAD etc)url
- requested URL path (should start "/")headerMap
- map of HTTP request header key-value pairsremoteAddress
- address of the client making the requestbody
- bytes comprising request body, or null if none presentpublic String getMethod()
public String getUrl()
public Map getHeaderMap()
HttpServer.getHeader(java.util.Map, java.lang.String)
utility method
can be used to interrogate the returned map.public SocketAddress getRemoteAddress()
public byte[] getBody()
Copyright © 2008–2024. All rights reserved.