public class HTTPRequest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
HTTPRequest.Header
A class to hold headers.
|
Constructor and Description |
---|
HTTPRequest(java.lang.String aString)
Creates a new URL from string.
|
HTTPRequest(java.net.URL aURL)
Creates a new URL from Java URL.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String aKey,
java.lang.String aValue)
Adds a header for key.
|
byte[] |
getBytes()
Returns the bytes associated with request (POST).
|
java.lang.String |
getCookie()
Returns the cookie.
|
java.util.List<HTTPRequest.Header> |
getHeaders()
Returns the headers.
|
HTTPResponse |
getResponse()
Executes this request and returns a response.
|
java.net.URL |
getURL()
Returns the URL.
|
java.lang.String |
getURLString()
Returns the URL string.
|
void |
setBytes(byte[] theBytes)
Sets the bytes associated with the request (POST).
|
void |
setCookie(java.lang.String aString)
Sets the cookie.
|
java.lang.String |
toString()
Standard toString implementation.
|
public HTTPRequest(java.net.URL aURL)
public HTTPRequest(java.lang.String aString)
public java.net.URL getURL()
public java.lang.String getURLString()
public java.lang.String getCookie()
public void setCookie(java.lang.String aString)
public java.util.List<HTTPRequest.Header> getHeaders()
public void addHeader(java.lang.String aKey, java.lang.String aValue)
public byte[] getBytes()
public void setBytes(byte[] theBytes)
public HTTPResponse getResponse() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object