|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HttpClient
Interface defining operations to enable transmitting HTTP GET and HTTP POST requests and returning the corresponding HTTP response.
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
Size of the byte buffer (1024 bytes) used for reading data chunks of data from an HTTP input stream. |
static String |
CHARACTER_ENCODING_SCHEMA
Character encoding schema used to convert response body bytes (UTF-8) to String. |
| Method Summary | |
|---|---|
HttpResponse |
transmitGET(String url,
String contentType,
String username,
String password,
HttpHeaderList headers)
Performs the HTTP GET of the URL and returns the corresponding response message. |
HttpResponse |
transmitPOST(String url,
ByteArrayOutputStream payload,
String contentType,
String username,
String password,
HttpHeaderList headers)
Performs the HTTP POST of the request message and returns the corresponding response message. |
| Field Detail |
|---|
static final String CHARACTER_ENCODING_SCHEMA
static final int BUFFER_SIZE
| Method Detail |
|---|
HttpResponse transmitPOST(String url,
ByteArrayOutputStream payload,
String contentType,
String username,
String password,
HttpHeaderList headers)
throws MalformedURLException,
SocketTimeoutException,
IOException
url - the URL to send the request topayload - the request to sendcontentType - the type of content being transmitted; will be set as a 'Content-Type' HTTP header (if the headers parameter has
a header with a name Content-Type this value will be overridden)username - the user name for authenticationpassword - the password for authenticationheaders - Any additional custom headers that will overwrite any default headers. Can be null, or zero or more HTTP headers
to include with the POST.
MalformedURLException - if the URL specified is malformed
SocketTimeoutException - if the timeout expires before the connection can be established; it can also be thrown when reading from the
returned input stream if the read timeout expires before data is available to be read
IOException - if any IO errors occur
HttpResponse transmitGET(String url,
String contentType,
String username,
String password,
HttpHeaderList headers)
throws MalformedURLException,
SocketTimeoutException,
IOException
url - the URL to send the request tocontentType - the type of content being transmitted; will be set as a 'Content-Type' HTTP header (if the headers parameter has
a header with a name Content-Type this value will be overridden)username - the user name for authenticationpassword - the password for authenticationheaders - Any additional custom headers that will overwrite any default headers. Can be null, or zero or more HTTP headers
to include with the GET.
MalformedURLException - if the URL specified is malformed
SocketTimeoutException - if the timeout expires before the connection can be established; it can also be thrown when reading from the
returned input stream if the read timeout expires before data is available to be read
IOException - if any IO errors occur
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||