public class UrlConnectionHttpClient extends Object implements IHttpClient
AMPERSAND, AUTHORIZATION_BASIC, COLON, EQUALS, MEDIATYPE_APPLICATION_FORMURLENCODED, MEDIATYPE_APPLICATION_JSON, MEDIATYPE_APPLICATION_XML, PROPERTY_ACCEPT, PROPERTY_AUTHIV, PROPERTY_AUTHKEY, PROPERTY_AUTHORIZATION, PROPERTY_CONTENT_TYPE, PROPERTY_USER_AGENT, SEMICOLON, SPACE, STATUS_BAD_REQUEST, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_OK, STATUS_UNAUTHORIZED, VERSION| Constructor and Description |
|---|
UrlConnectionHttpClient(String username,
String password,
String userAgent,
boolean sslChecks,
IMediaType requestMediaType,
String acceptedMediaType,
String version) |
UrlConnectionHttpClient(String username,
String password,
String userAgent,
boolean sslChecks,
IMediaType requestMediaType,
String acceptedMediaType,
String version,
String authKey,
String authIV) |
| Modifier and Type | Method and Description |
|---|---|
protected HttpURLConnection |
createConnection(String username,
String password,
String authKey,
String authIV,
String userAgent,
URL url) |
protected HttpURLConnection |
createConnection(String username,
String password,
String userAgent,
URL url) |
protected String |
createErrorMessage(IOException ioe,
HttpURLConnection connection) |
String |
delete(Map<String,Object> parameters,
URL url) |
protected String |
delete(String data,
URL url) |
String |
delete(URL url) |
String |
get(URL url) |
String |
getAcceptedMediaType() |
String |
getUserAgent() |
String |
post(Map<String,Object> parameters,
URL url) |
protected String |
post(String data,
URL url) |
String |
put(Map<String,Object> parameters,
URL url) |
protected String |
put(String data,
URL url) |
void |
setAcceptedMediaType(String acceptedMediaType) |
void |
setUserAgent(String userAgent) |
void |
setVersion(String version) |
protected String |
write(String data,
String requestMethod,
URL url) |
public UrlConnectionHttpClient(String username, String password, String userAgent, boolean sslChecks, IMediaType requestMediaType, String acceptedMediaType, String version)
public void setAcceptedMediaType(String acceptedMediaType)
setAcceptedMediaType in interface IHttpClientpublic String getAcceptedMediaType()
getAcceptedMediaType in interface IHttpClientpublic String get(URL url) throws HttpClientException, SocketTimeoutException
get in interface IHttpClientHttpClientExceptionSocketTimeoutExceptionpublic void setUserAgent(String userAgent)
setUserAgent in interface IHttpClientpublic String getUserAgent()
getUserAgent in interface IHttpClientpublic void setVersion(String version)
setVersion in interface IHttpClientpublic String put(Map<String,Object> parameters, URL url) throws SocketTimeoutException, UnsupportedEncodingException, HttpClientException
put in interface IHttpClientSocketTimeoutExceptionUnsupportedEncodingExceptionHttpClientExceptionprotected String put(String data, URL url) throws HttpClientException, SocketTimeoutException
public String post(Map<String,Object> parameters, URL url) throws SocketTimeoutException, UnsupportedEncodingException, HttpClientException
post in interface IHttpClientSocketTimeoutExceptionUnsupportedEncodingExceptionHttpClientExceptionprotected String post(String data, URL url) throws HttpClientException, SocketTimeoutException
public String delete(Map<String,Object> parameters, URL url) throws HttpClientException, SocketTimeoutException, UnsupportedEncodingException
delete in interface IHttpClientHttpClientExceptionSocketTimeoutExceptionUnsupportedEncodingExceptionpublic String delete(URL url) throws HttpClientException, SocketTimeoutException, UnsupportedEncodingException
delete in interface IHttpClientHttpClientExceptionSocketTimeoutExceptionUnsupportedEncodingExceptionprotected String delete(String data, URL url) throws HttpClientException, SocketTimeoutException
protected String write(String data, String requestMethod, URL url) throws SocketTimeoutException, HttpClientException
protected String createErrorMessage(IOException ioe, HttpURLConnection connection) throws IOException
IOExceptionprotected HttpURLConnection createConnection(String username, String password, String userAgent, URL url) throws IOException
IOExceptionprotected HttpURLConnection createConnection(String username, String password, String authKey, String authIV, String userAgent, URL url) throws IOException
IOExceptionCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.