public class HttpClientConnection extends Object implements HttpConnection
HttpConnection
which uses HttpClient
HTTP_FORBIDDEN, HTTP_NOT_FOUND, HTTP_OK, HTTP_UNAUTHORIZED
Constructor and Description |
---|
HttpClientConnection(String urlStr) |
HttpClientConnection(String urlStr,
Proxy proxy) |
HttpClientConnection(String urlStr,
Proxy proxy,
org.apache.http.client.HttpClient cl) |
Modifier and Type | Method and Description |
---|---|
void |
configure(KeyManager[] km,
TrustManager[] tm,
SecureRandom random) |
void |
connect() |
int |
getContentLength() |
String |
getContentType() |
String |
getHeaderField(String name) |
Map<String,List<String>> |
getHeaderFields() |
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
String |
getRequestMethod() |
int |
getResponseCode() |
String |
getResponseMessage() |
URL |
getURL() |
void |
setBuffer(TemporaryBuffer buffer)
Sets the buffer from which to take the request body
|
void |
setChunkedStreamingMode(int chunklen) |
void |
setConnectTimeout(int timeout) |
void |
setDoOutput(boolean dooutput) |
void |
setFixedLengthStreamingMode(int contentLength) |
void |
setHostnameVerifier(HostnameVerifier hostnameverifier) |
void |
setInstanceFollowRedirects(boolean followRedirects) |
void |
setReadTimeout(int readTimeout) |
void |
setRequestMethod(String method) |
void |
setRequestProperty(String name,
String value) |
void |
setUseCaches(boolean usecaches) |
boolean |
usingProxy() |
public HttpClientConnection(String urlStr)
urlStr
- public HttpClientConnection(String urlStr, Proxy proxy)
urlStr
- proxy
- public void setBuffer(TemporaryBuffer buffer)
buffer
- public int getResponseCode() throws IOException
getResponseCode
in interface HttpConnection
IOException
public URL getURL()
getURL
in interface HttpConnection
public String getResponseMessage() throws IOException
getResponseMessage
in interface HttpConnection
IOException
public Map<String,List<String>> getHeaderFields()
getHeaderFields
in interface HttpConnection
public void setRequestProperty(String name, String value)
setRequestProperty
in interface HttpConnection
public void setRequestMethod(String method) throws ProtocolException
setRequestMethod
in interface HttpConnection
ProtocolException
public void setUseCaches(boolean usecaches)
setUseCaches
in interface HttpConnection
public void setConnectTimeout(int timeout)
setConnectTimeout
in interface HttpConnection
public void setReadTimeout(int readTimeout)
setReadTimeout
in interface HttpConnection
public String getContentType()
getContentType
in interface HttpConnection
public InputStream getInputStream() throws IOException
getInputStream
in interface HttpConnection
IOException
public String getHeaderField(String name)
getHeaderField
in interface HttpConnection
public int getContentLength()
getContentLength
in interface HttpConnection
public void setInstanceFollowRedirects(boolean followRedirects)
setInstanceFollowRedirects
in interface HttpConnection
public void setDoOutput(boolean dooutput)
setDoOutput
in interface HttpConnection
public void setFixedLengthStreamingMode(int contentLength)
setFixedLengthStreamingMode
in interface HttpConnection
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface HttpConnection
IOException
public void setChunkedStreamingMode(int chunklen)
setChunkedStreamingMode
in interface HttpConnection
public String getRequestMethod()
getRequestMethod
in interface HttpConnection
public boolean usingProxy()
usingProxy
in interface HttpConnection
public void connect() throws IOException
connect
in interface HttpConnection
IOException
public void setHostnameVerifier(HostnameVerifier hostnameverifier)
setHostnameVerifier
in interface HttpConnection
public void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws KeyManagementException
configure
in interface HttpConnection
KeyManagementException
Copyright © 2014. All rights reserved.