SMILA 1.0 API documentation

org.eclipse.smila.http.client.impl.base
Interface HttpRequestFactory

All Known Implementing Classes:
DefaultHttpRequestFactory

public interface HttpRequestFactory

Factory that prepares Apache HTTP client related objects for the RestClient. The interface has been defined to be able to modify details of the HTTP requests created by the RestClient for special use cases. Usually the default implementation provided by this bundle is completely sufficient, so a standard user does not need to care about these things.


Field Summary
static java.nio.charset.Charset CHARSET
          Default charset for char-to-byte conversion.
static java.lang.String CONTENTTYPE_JSON
          Content-Type header value for JSON with UTF-8 charset.
static java.lang.String ENCODING
          Default encoding for char-to-byte conversion.
static java.lang.String MIMETYPE_JSON
          MIME type of JSON.
 
Method Summary
 HttpEntity createEntity(java.io.InputStream inputStream, java.lang.String contentType)
          Wrap an input stream with any content type as an HttpEntity.
 HttpEntity createHttpEntity(Any parameters, Attachments attachments)
          Create an HTTP entity from the input data.
 HttpEntity createJsonEntity(Any parameters)
          Write parameters to JSON and wrap as an HttpEntity.
 HttpEntity createJsonEntity(java.io.InputStream inputStream)
          Wrap an UTF-8-JSON input stream as an HttpEntity.
 HttpEntity createMultipartEntity(Any parameters, Attachments attachments)
          Create a multipart entity for a JSON metadata body and attachments.
 HttpUriRequest getHttpMethod(HttpMethod method, java.lang.String url)
          Create request object for method and url.
 HttpUriRequest getHttpMethod(HttpMethod method, java.lang.String url, HttpParams methodParams)
          Create request object for method and URL and set optional parameters.
 

Field Detail

MIMETYPE_JSON

static final java.lang.String MIMETYPE_JSON
MIME type of JSON.

See Also:
Constant Field Values

ENCODING

static final java.lang.String ENCODING
Default encoding for char-to-byte conversion.

See Also:
Constant Field Values

CONTENTTYPE_JSON

static final java.lang.String CONTENTTYPE_JSON
Content-Type header value for JSON with UTF-8 charset.

See Also:
Constant Field Values

CHARSET

static final java.nio.charset.Charset CHARSET
Default charset for char-to-byte conversion.

Method Detail

getHttpMethod

HttpUriRequest getHttpMethod(HttpMethod method,
                             java.lang.String url)
Create request object for method and url.


getHttpMethod

HttpUriRequest getHttpMethod(HttpMethod method,
                             java.lang.String url,
                             HttpParams methodParams)
Create request object for method and URL and set optional parameters.


createJsonEntity

HttpEntity createJsonEntity(Any parameters)
                            throws java.io.IOException
Write parameters to JSON and wrap as an HttpEntity.

Throws:
java.io.IOException

createJsonEntity

HttpEntity createJsonEntity(java.io.InputStream inputStream)
                            throws java.io.IOException
Wrap an UTF-8-JSON input stream as an HttpEntity.

Throws:
java.io.IOException

createEntity

HttpEntity createEntity(java.io.InputStream inputStream,
                        java.lang.String contentType)
                        throws java.io.IOException
Wrap an input stream with any content type as an HttpEntity.

Throws:
java.io.IOException

createHttpEntity

HttpEntity createHttpEntity(Any parameters,
                            Attachments attachments)
                            throws java.io.IOException
Create an HTTP entity from the input data.

Throws:
java.io.IOException

createMultipartEntity

HttpEntity createMultipartEntity(Any parameters,
                                 Attachments attachments)
                                 throws java.io.IOException
Create a multipart entity for a JSON metadata body and attachments.

Throws:
java.io.IOException

SMILA 1.0 API documentation