|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.util.http.SimpleHttpConnector
public final class SimpleHttpConnector
Simple http connector using the built-in HttpURLConnection
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.dyuproject.util.http.HttpConnector |
---|
HttpConnector.Parameter, HttpConnector.Response |
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
THe default buffer size (4096 or the system property "shc.buffer_size") |
static int |
DEFAULT_CONNECT_TIMEOUT
The default connect timeout (10000 or the system property "shc.connect_timeout") |
static boolean |
DEFAULT_FOLLOW_REDIRECT
The defualt follow redirect flag (false or the system property "shc.follow_redirects") |
Fields inherited from interface com.dyuproject.util.http.HttpConnector |
---|
CONTENT_LENGTH_HEADER, CONTENT_TYPE_HEADER, DEFAULT_ENCODING, DELETE, GET, HEAD, POST, PUT, X_WWW_FORM_URLENCODED |
Constructor Summary | |
---|---|
SimpleHttpConnector()
|
|
SimpleHttpConnector(int bufferSize,
int connectTimeout,
boolean followRedirects)
|
Method Summary | |
---|---|
HttpConnector.Response |
doDELETE(String url,
Iterable<HttpConnector.Parameter> headers)
Makes a DELETE request with the given http headers . |
HttpConnector.Response |
doDELETE(String url,
Iterable<HttpConnector.Parameter> headers,
Iterable<HttpConnector.Parameter> parameters)
Makes a DELETE request with the given http headers , parameters . |
HttpConnector.Response |
doDELETE(String url,
Iterable<HttpConnector.Parameter> headers,
Map<?,?> parameters)
Makes a DELETE request with the given http headers , parameters . |
HttpConnector.Response |
doDELETE(String url,
Map<?,?> headers)
Makes a DELETE request with the given http headers . |
HttpConnector.Response |
doDELETE(String url,
Map<?,?> headers,
Map<?,?> parameters)
Makes a DELETE request with the given http headers , parameters . |
HttpConnector.Response |
doGET(String url,
Iterable<HttpConnector.Parameter> headers)
Makes a GET request with the given http headers . |
HttpConnector.Response |
doGET(String url,
Iterable<HttpConnector.Parameter> headers,
Iterable<HttpConnector.Parameter> parameters)
Makes a GET request with the given http headers , parameters . |
HttpConnector.Response |
doGET(String url,
Iterable<HttpConnector.Parameter> headers,
Map<?,?> parameters)
Makes a GET request with the given http headers , parameters . |
HttpConnector.Response |
doGET(String url,
Map<?,?> headers)
Makes a GET request with the given http headers . |
HttpConnector.Response |
doGET(String url,
Map<?,?> headers,
Map<?,?> parameters)
Makes a GET request with the given http headers , parameters . |
HttpConnector.Response |
doHEAD(String url,
Iterable<HttpConnector.Parameter> headers)
Makes a HEAD request with the given http headers . |
HttpConnector.Response |
doHEAD(String url,
Map<?,?> headers)
Makes a HEAD request with the given http headers . |
HttpConnector.Response |
doPOST(String url,
Iterable<HttpConnector.Parameter> headers,
Iterable<HttpConnector.Parameter> parameters,
String charset)
Makes a POST request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPOST(String url,
Iterable<HttpConnector.Parameter> headers,
Map<?,?> parameters,
String charset)
Makes a POST request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPOST(String url,
Iterable<HttpConnector.Parameter> headers,
String contentType,
byte[] data)
Makes a POST request with the given http headers , parameters ,
contentType and the content data . |
HttpConnector.Response |
doPOST(String url,
Iterable<HttpConnector.Parameter> headers,
String contentType,
InputStreamReader reader)
Makes a POST request with the given http headers , parameters ,
contentType and the content reader as InputStreamReader. |
HttpConnector.Response |
doPOST(String url,
Map<?,?> headers,
Iterable<HttpConnector.Parameter> parameters,
String charset)
Makes a POST request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPOST(String url,
Map<?,?> headers,
Map<?,?> parameters,
String charset)
Makes a POST request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPOST(String url,
Map<?,?> headers,
String contentType,
byte[] data)
Makes a POST request with the given http headers , parameters and
the content data . |
HttpConnector.Response |
doPOST(String url,
Map<?,?> headers,
String contentType,
InputStreamReader reader)
Makes a POST request with the given http headers , parameters ,
contentType and the content reader as InputStreamReader. |
HttpConnector.Response |
doPUT(String url,
Iterable<HttpConnector.Parameter> headers,
Iterable<HttpConnector.Parameter> parameters,
String charset)
Makes a PUT request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPUT(String url,
Iterable<HttpConnector.Parameter> headers,
Map<?,?> parameters,
String charset)
Makes a PUT request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPUT(String url,
Iterable<HttpConnector.Parameter> headers,
String contentType,
byte[] data)
Makes a PUT request with the given http headers , parameters and
the content data . |
HttpConnector.Response |
doPUT(String url,
Iterable<HttpConnector.Parameter> headers,
String contentType,
InputStreamReader reader)
Makes a PUT request with the given http headers , parameters ,
contentType and the content reader as InputStreamReader. |
HttpConnector.Response |
doPUT(String url,
Map<?,?> headers,
Iterable<HttpConnector.Parameter> parameters,
String charset)
Makes a PUT request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPUT(String url,
Map<?,?> headers,
Map<?,?> parameters,
String charset)
Makes a PUT request with the given http headers , parameters and the
charset - which will be appended in the Content-Type header. |
HttpConnector.Response |
doPUT(String url,
Map<?,?> headers,
String contentType,
byte[] data)
Makes a PUT request with the given http headers , parameters and
the content data . |
HttpConnector.Response |
doPUT(String url,
Map<?,?> headers,
String contentType,
InputStreamReader reader)
Makes a PUT request with the given http headers , parameters ,
contentType and the content reader as InputStreamReader. |
int |
getBufferSize()
Gets the buffer size. |
int |
getConnectTimeout()
Gets the connection timeout. |
static SimpleHttpConnector |
getDefault()
Gets the default instance. |
boolean |
isFollowRedirects()
Checks whether this instance follows redirects or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_BUFFER_SIZE
public static int DEFAULT_CONNECT_TIMEOUT
public static boolean DEFAULT_FOLLOW_REDIRECT
Constructor Detail |
---|
public SimpleHttpConnector()
public SimpleHttpConnector(int bufferSize, int connectTimeout, boolean followRedirects)
Method Detail |
---|
public static SimpleHttpConnector getDefault()
public int getBufferSize()
public int getConnectTimeout()
public boolean isFollowRedirects()
public HttpConnector.Response doHEAD(String url, Map<?,?> headers) throws IOException
HttpConnector
headers
.
doHEAD
in interface HttpConnector
IOException
public HttpConnector.Response doHEAD(String url, Iterable<HttpConnector.Parameter> headers) throws IOException
HttpConnector
headers
.
doHEAD
in interface HttpConnector
IOException
public HttpConnector.Response doGET(String url, Map<?,?> headers) throws IOException
HttpConnector
headers
.
doGET
in interface HttpConnector
IOException
public HttpConnector.Response doGET(String url, Iterable<HttpConnector.Parameter> headers) throws IOException
HttpConnector
headers
.
doGET
in interface HttpConnector
IOException
public HttpConnector.Response doGET(String url, Map<?,?> headers, Map<?,?> parameters) throws IOException
HttpConnector
headers
, parameters
.
doGET
in interface HttpConnector
IOException
public HttpConnector.Response doGET(String url, Iterable<HttpConnector.Parameter> headers, Map<?,?> parameters) throws IOException
HttpConnector
headers
, parameters
.
doGET
in interface HttpConnector
IOException
public HttpConnector.Response doGET(String url, Iterable<HttpConnector.Parameter> headers, Iterable<HttpConnector.Parameter> parameters) throws IOException
HttpConnector
headers
, parameters
.
doGET
in interface HttpConnector
IOException
public HttpConnector.Response doDELETE(String url, Map<?,?> headers) throws IOException
HttpConnector
headers
.
doDELETE
in interface HttpConnector
IOException
public HttpConnector.Response doDELETE(String url, Iterable<HttpConnector.Parameter> headers) throws IOException
HttpConnector
headers
.
doDELETE
in interface HttpConnector
IOException
public HttpConnector.Response doDELETE(String url, Map<?,?> headers, Map<?,?> parameters) throws IOException
HttpConnector
headers
, parameters
.
doDELETE
in interface HttpConnector
IOException
public HttpConnector.Response doDELETE(String url, Iterable<HttpConnector.Parameter> headers, Map<?,?> parameters) throws IOException
HttpConnector
headers
, parameters
.
doDELETE
in interface HttpConnector
IOException
public HttpConnector.Response doDELETE(String url, Iterable<HttpConnector.Parameter> headers, Iterable<HttpConnector.Parameter> parameters) throws IOException
HttpConnector
headers
, parameters
.
doDELETE
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Map<?,?> headers, Map<?,?> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Map<?,?> headers, Iterable<HttpConnector.Parameter> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Iterable<HttpConnector.Parameter> headers, Map<?,?> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Iterable<HttpConnector.Parameter> headers, Iterable<HttpConnector.Parameter> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Map<?,?> headers, String contentType, byte[] data) throws IOException
HttpConnector
headers
, parameters
and
the content data
.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Iterable<HttpConnector.Parameter> headers, String contentType, byte[] data) throws IOException
HttpConnector
headers
, parameters
,
contentType
and the content data
.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Map<?,?> headers, String contentType, InputStreamReader reader) throws IOException
HttpConnector
headers
, parameters
,
contentType
and the content reader
as InputStreamReader.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPOST(String url, Iterable<HttpConnector.Parameter> headers, String contentType, InputStreamReader reader) throws IOException
HttpConnector
headers
, parameters
,
contentType
and the content reader
as InputStreamReader.
doPOST
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Map<?,?> headers, Map<?,?> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Map<?,?> headers, Iterable<HttpConnector.Parameter> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Iterable<HttpConnector.Parameter> headers, Map<?,?> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Iterable<HttpConnector.Parameter> headers, Iterable<HttpConnector.Parameter> parameters, String charset) throws IOException
HttpConnector
headers
, parameters
and the
charset
- which will be appended in the Content-Type header.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Map<?,?> headers, String contentType, byte[] data) throws IOException
HttpConnector
headers
, parameters
and
the content data
.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Iterable<HttpConnector.Parameter> headers, String contentType, byte[] data) throws IOException
HttpConnector
headers
, parameters
and
the content data
.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Map<?,?> headers, String contentType, InputStreamReader reader) throws IOException
HttpConnector
headers
, parameters
,
contentType
and the content reader
as InputStreamReader.
doPUT
in interface HttpConnector
IOException
public HttpConnector.Response doPUT(String url, Iterable<HttpConnector.Parameter> headers, String contentType, InputStreamReader reader) throws IOException
HttpConnector
headers
, parameters
,
contentType
and the content reader
as InputStreamReader.
doPUT
in interface HttpConnector
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |