public interface HttpRequestFactory
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.| Modifier and Type | Field and Description |
|---|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
static final java.lang.String MIMETYPE_JSON
static final java.lang.String ENCODING
static final java.lang.String CONTENTTYPE_JSON
static final java.nio.charset.Charset CHARSET
HttpUriRequest getHttpMethod(HttpMethod method, java.lang.String url)
HttpUriRequest getHttpMethod(HttpMethod method, java.lang.String url, HttpParams methodParams)
HttpEntity createJsonEntity(Any parameters) throws java.io.IOException
HttpEntity.java.io.IOExceptionHttpEntity createJsonEntity(java.io.InputStream inputStream)
throws java.io.IOException
HttpEntity.java.io.IOExceptionHttpEntity createEntity(java.io.InputStream inputStream,
java.lang.String contentType)
throws java.io.IOException
HttpEntity.java.io.IOExceptionHttpEntity createHttpEntity(Any parameters, Attachments attachments) throws java.io.IOException
java.io.IOExceptionHttpEntity createMultipartEntity(Any parameters, Attachments attachments) throws java.io.IOException
java.io.IOException