com.dyuproject.util.http
Interface HttpConnector

All Known Implementing Classes:
SimpleHttpConnector

public interface HttpConnector

HttpConnector - reads/writes bytes from/to http endpoints.

Author:
David Yu
Date created:
Sep 8, 2008

Nested Class Summary
static class HttpConnector.Parameter
          A key/value pair
static interface HttpConnector.Response
          The http response which can be used to obtain the http status, headers and the content via input stream.
 
Field Summary
static String CONTENT_LENGTH_HEADER
           
static String CONTENT_TYPE_HEADER
           
static String DEFAULT_ENCODING
           
static String DELETE
           
static String GET
           
static String HEAD
           
static String POST
           
static String PUT
           
static String X_WWW_FORM_URLENCODED
           
 
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.
 

Field Detail

HEAD

static final String HEAD
See Also:
Constant Field Values

GET

static final String GET
See Also:
Constant Field Values

POST

static final String POST
See Also:
Constant Field Values

PUT

static final String PUT
See Also:
Constant Field Values

DELETE

static final String DELETE
See Also:
Constant Field Values

CONTENT_TYPE_HEADER

static final String CONTENT_TYPE_HEADER
See Also:
Constant Field Values

CONTENT_LENGTH_HEADER

static final String CONTENT_LENGTH_HEADER
See Also:
Constant Field Values

X_WWW_FORM_URLENCODED

static final String X_WWW_FORM_URLENCODED
See Also:
Constant Field Values

DEFAULT_ENCODING

static final String DEFAULT_ENCODING
Method Detail

doHEAD

HttpConnector.Response doHEAD(String url,
                              Map<?,?> headers)
                              throws IOException
Makes a HEAD request with the given http headers.

Throws:
IOException

doHEAD

HttpConnector.Response doHEAD(String url,
                              Iterable<HttpConnector.Parameter> headers)
                              throws IOException
Makes a HEAD request with the given http headers.

Throws:
IOException

doGET

HttpConnector.Response doGET(String url,
                             Map<?,?> headers)
                             throws IOException
Makes a GET request with the given http headers.

Throws:
IOException

doGET

HttpConnector.Response doGET(String url,
                             Iterable<HttpConnector.Parameter> headers)
                             throws IOException
Makes a GET request with the given http headers.

Throws:
IOException

doGET

HttpConnector.Response doGET(String url,
                             Map<?,?> headers,
                             Map<?,?> parameters)
                             throws IOException
Makes a GET request with the given http headers, parameters.

Throws:
IOException

doGET

HttpConnector.Response doGET(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             Map<?,?> parameters)
                             throws IOException
Makes a GET request with the given http headers, parameters.

Throws:
IOException

doGET

HttpConnector.Response doGET(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             Iterable<HttpConnector.Parameter> parameters)
                             throws IOException
Makes a GET request with the given http headers, parameters.

Throws:
IOException

doDELETE

HttpConnector.Response doDELETE(String url,
                                Map<?,?> headers)
                                throws IOException
Makes a DELETE request with the given http headers.

Throws:
IOException

doDELETE

HttpConnector.Response doDELETE(String url,
                                Iterable<HttpConnector.Parameter> headers)
                                throws IOException
Makes a DELETE request with the given http headers.

Throws:
IOException

doDELETE

HttpConnector.Response doDELETE(String url,
                                Map<?,?> headers,
                                Map<?,?> parameters)
                                throws IOException
Makes a DELETE request with the given http headers, parameters.

Throws:
IOException

doDELETE

HttpConnector.Response doDELETE(String url,
                                Iterable<HttpConnector.Parameter> headers,
                                Map<?,?> parameters)
                                throws IOException
Makes a DELETE request with the given http headers, parameters.

Throws:
IOException

doDELETE

HttpConnector.Response doDELETE(String url,
                                Iterable<HttpConnector.Parameter> headers,
                                Iterable<HttpConnector.Parameter> parameters)
                                throws IOException
Makes a DELETE request with the given http headers, parameters.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Map<?,?> headers,
                              Map<?,?> parameters,
                              String charset)
                              throws IOException
Makes a POST request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Map<?,?> headers,
                              Iterable<HttpConnector.Parameter> parameters,
                              String charset)
                              throws IOException
Makes a POST request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Iterable<HttpConnector.Parameter> headers,
                              Map<?,?> parameters,
                              String charset)
                              throws IOException
Makes a POST request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Iterable<HttpConnector.Parameter> headers,
                              Iterable<HttpConnector.Parameter> parameters,
                              String charset)
                              throws IOException
Makes a POST request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Map<?,?> headers,
                              String contentType,
                              byte[] data)
                              throws IOException
Makes a POST request with the given http headers, parameters and the content data.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Iterable<HttpConnector.Parameter> headers,
                              String contentType,
                              byte[] data)
                              throws IOException
Makes a POST request with the given http headers, parameters, contentType and the content data.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Map<?,?> headers,
                              String contentType,
                              InputStreamReader reader)
                              throws IOException
Makes a POST request with the given http headers, parameters, contentType and the content reader as InputStreamReader.

Throws:
IOException

doPOST

HttpConnector.Response doPOST(String url,
                              Iterable<HttpConnector.Parameter> headers,
                              String contentType,
                              InputStreamReader reader)
                              throws IOException
Makes a POST request with the given http headers, parameters, contentType and the content reader as InputStreamReader.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Map<?,?> headers,
                             Map<?,?> parameters,
                             String charset)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Map<?,?> headers,
                             Iterable<HttpConnector.Parameter> parameters,
                             String charset)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             Map<?,?> parameters,
                             String charset)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             Iterable<HttpConnector.Parameter> parameters,
                             String charset)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the charset - which will be appended in the Content-Type header.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Map<?,?> headers,
                             String contentType,
                             byte[] data)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the content data.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             String contentType,
                             byte[] data)
                             throws IOException
Makes a PUT request with the given http headers, parameters and the content data.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Map<?,?> headers,
                             String contentType,
                             InputStreamReader reader)
                             throws IOException
Makes a PUT request with the given http headers, parameters, contentType and the content reader as InputStreamReader.

Throws:
IOException

doPUT

HttpConnector.Response doPUT(String url,
                             Iterable<HttpConnector.Parameter> headers,
                             String contentType,
                             InputStreamReader reader)
                             throws IOException
Makes a PUT request with the given http headers, parameters, contentType and the content reader as InputStreamReader.

Throws:
IOException


Copyright © 2008-2013. All Rights Reserved.