public class OkHTTPClient extends HTTPBase
Modifier and Type | Class and Description |
---|---|
static class |
OkHTTPClient.Builder
Builder design pattern class.
|
static class |
OkHTTPClient.RequestBuilder
Builder design pattern class.
|
Modifier and Type | Field and Description |
---|---|
static java.net.CookieManager |
_cookieManager |
_logger, _responseCharset, _responseCode, _responseHeaders, DEFAULT_HTTP_RESPONSECODE, ShowConnectionTrace
Modifier and Type | Method and Description |
---|---|
static OkHTTPClient.Builder |
getBuilder(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Returns HTTPClient instance builder.
|
byte[] |
getByteArrayResponse()
Get the response as byte array.
|
int |
getResponse()
Establish the connection and returns the status.
|
java.io.InputStream |
getStreamResponse()
Get the response as stream.
|
java.lang.String |
getStringResponse()
Get the response as string encoded in charset recovered in response headers.
|
java.lang.String |
getStringResponse(java.nio.charset.Charset charset)
Get the response as string.
|
OkHTTPClient |
setRequest(OkHTTPClient.RequestBuilder request) |
getLastResponse, getResponseHeaders, getStringCode, SetTlsClientCompatibleAlgorithm
public static OkHTTPClient.Builder getBuilder(javax.net.ssl.SSLSocketFactory sslSocketFactory)
public OkHTTPClient setRequest(OkHTTPClient.RequestBuilder request)
request
- The request builder instance to use.public java.io.InputStream getStreamResponse() throws java.io.IOException
getStreamResponse
in class HTTPBase
java.io.IOException
- if exception occurs.public int getResponse() throws java.io.IOException
getResponse
in class HTTPBase
java.io.IOException
- if exception occurs.public java.lang.String getStringResponse() throws java.io.IOException
getStringResponse
in class HTTPBase
java.io.IOException
- if exception occurs.public java.lang.String getStringResponse(java.nio.charset.Charset charset) throws java.io.IOException
getStringResponse
in class HTTPBase
charset
- Character encoding of the response.java.io.IOException
- if exception occurs.public byte[] getByteArrayResponse() throws java.io.IOException
getByteArrayResponse
in class HTTPBase
java.io.IOException
- if exception occurs.