public class HttpComponents42Client extends AbstractClient
DELETE_METHOD, GET_METHOD, LIVE_API, POST_METHOD, PUT_METHOD, SANDBOX_API
Constructor and Description |
---|
HttpComponents42Client(String apiBaseUrl,
String apiAccessKey,
String apiAccessSecret) |
HttpComponents42Client(String apiBaseUrl,
String apiAccessKey,
String apiAccessSecret,
org.apache.http.client.HttpClient httpClient) |
Modifier and Type | Method and Description |
---|---|
protected oauth.signpost.OAuthConsumer |
buildOAuthConsumer(String apiAccessKey,
String apiAccessSecret) |
protected oauth.signpost.OAuthProvider |
buildOAuthProvider(String apiBaseUrl) |
protected Response |
createResponse(org.apache.http.HttpResponse response) |
protected Response |
sendVideoUploadRequest(URL url,
RequestMethod method,
String auth,
InputStream input,
String fileName,
long fileSize)
Sends video with an authentication value to a webservice.
|
protected Response |
sendXmlAttachmentRequest(URL url,
RequestMethod method,
String xml,
InputStream input,
String fileName,
String mimeType)
Sends XML string together with a file to a webservice.
|
protected Response |
sendXmlRequest(URL url,
RequestMethod method,
String xml)
Sends XML string to a webservice.
|
void |
setDefaultHttpClient() |
void |
setDefaultHttpClient(int timeout) |
void |
setHttpClient(org.apache.http.client.HttpClient httpClient) |
authorize, authorize, authorizeAfterVerification, authorizeAfterVerification, fetchVerification, fetchVerification, getApiBaseUrl, getAuthConsumer, getAuthProvider, getEncodedParameterValue, getEncoding
public HttpComponents42Client(String apiBaseUrl, String apiAccessKey, String apiAccessSecret)
protected oauth.signpost.OAuthConsumer buildOAuthConsumer(String apiAccessKey, String apiAccessSecret)
buildOAuthConsumer
in class AbstractClient
protected oauth.signpost.OAuthProvider buildOAuthProvider(String apiBaseUrl)
buildOAuthProvider
in class AbstractClient
protected Response createResponse(org.apache.http.HttpResponse response) throws IOException
IOException
protected Response sendXmlRequest(URL url, RequestMethod method, String xml) throws IOException, oauth.signpost.exception.OAuthException
AbstractClient
sendXmlRequest
in class AbstractClient
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestxml
- the XML string, that is sent to the webserviceIOException
oauth.signpost.exception.OAuthException
protected Response sendXmlAttachmentRequest(URL url, RequestMethod method, String xml, InputStream input, String fileName, String mimeType) throws IOException, oauth.signpost.exception.OAuthException
AbstractClient
sendXmlAttachmentRequest
in class AbstractClient
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestxml
- the XML string, that is sent to the webserviceinput
- the file content, that is sent to the webservicefileName
- the name of the file, that is sent to the webservicemimeType
- the MIME-type of the file, that is sent to the webserviceIOException
oauth.signpost.exception.OAuthException
protected Response sendVideoUploadRequest(URL url, RequestMethod method, String auth, InputStream input, String fileName, long fileSize) throws IOException, oauth.signpost.exception.OAuthException
AbstractClient
sendVideoUploadRequest
in class AbstractClient
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestauth
- the authentication value, that is sent to the webserviceinput
- the file content, that is sent to the webservicefileName
- the name of the file, that is sent to the webservicefileSize
- the size of the file, that is sent to the webservice (in bytes)IOException
oauth.signpost.exception.OAuthException
public void setDefaultHttpClient()
public void setDefaultHttpClient(int timeout)
public void setHttpClient(org.apache.http.client.HttpClient httpClient)
Copyright © 2014 OpenEstate. All rights reserved.