Interface HTTPRequest
public interface HTTPRequest
Details of an HTTP Request from a web server.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the request.byte[]
Returns a byte array containing the request content.Get specified header.Get headers.Get the method Name.getParameter
(String name) Get specified parameter.getPath()
Returns the path of request URL.Get the remote address of the HTTP request.long
Return the request time.getURL()
Returns the request URL.void
writeResponse
(ByteBuffer buffer) Write a response.
-
Method Details
-
getMethodName
String getMethodName()Get the method Name.- Returns:
- the method name
-
getURL
String getURL()Returns the request URL.- Returns:
- string representation of the URL
-
getPath
String getPath()Returns the path of request URL.- Returns:
- string representation of the path of the URL
-
getHeader
Get specified header.- Parameters:
name
- header name- Returns:
- header value or null if no such header
-
getHeaders
Get headers.Return all of the headers
- Returns:
- a HashMap of the headers contained within the request
- Since:
- 4.1
-
getRemoteAddress
String getRemoteAddress()Get the remote address of the HTTP request. If this has been forwarded-for, the forwarded for address will be used- Returns:
- the remote IP Address
- Since:
- 4.1
-
getParameter
Get specified parameter.- Parameters:
name
- parameter name- Returns:
- parameter value or null if no such parameter
-
getContent
byte[] getContent()Returns a byte array containing the request content.- Returns:
- byte array which could be zero length
-
getTimestamp
long getTimestamp()Return the request time.- Returns:
- the time in measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
-
writeResponse
Write a response.This will write the contents of the supplied buffer from its position to its limit.
- Parameters:
buffer
- containing the response- Throws:
APIException
- if unable to write
-
close
void close()Close the request.This closes its underlying channel.
-