Package com.landawn.abacus.http
Class HttpSettings
java.lang.Object
com.landawn.abacus.http.HttpSettings
- All Implemented Interfaces:
Cloneable
- Since:
- 1.3
- Author:
- Haiyang Li
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
static HttpSettings
create()
boolean
doInput()
doInput
(boolean doInput) Note: Only forHttpClient
, not forOKHttpClient
.boolean
doOutput()
doOutput
(boolean doOutput) Note: Only forHttpClient
, not forOKHttpClient
.int
Gets the connection timeout.Gets the content format.int
Gets the read timeout.Gets the SSL socket factory.boolean
Gets the use caches.Set http header specified byname/value
.headers()
headers
(HttpHeaders headers) Removes all headers on thisHttpSettings
and addsheaders
.Set http headers specified byname1/value1
,name2/value2
.Set http headers specified byname1/value1
,name2/value2
,name3/value3
.Set http headers specified by the key/value entities fromMap
.boolean
Checks if is one way request.isOneWayRequest
(boolean isOneWayRequest) Checks if is one way request.setConnectionTimeout
(int connectionTimeout) Note: Only forHttpClient
, not forOKHttpClient
.setContentEncoding
(String contentEncoding) setContentFormat
(ContentFormat contentFormat) Sets the content format.setContentType
(String contentType) setReadTimeout
(int readTimeout) Note: Only forHttpClient
, not forOKHttpClient
.setSSLSocketFactory
(SSLSocketFactory sslSocketFactory) Sets the SSL socket factory.setUseCaches
(boolean useCaches) Note: Only forHttpClient
, not forOKHttpClient
.toString()
-
Constructor Details
-
HttpSettings
public HttpSettings()
-
-
Method Details
-
create
-
getConnectionTimeout
public int getConnectionTimeout()Gets the connection timeout.- Returns:
-
setConnectionTimeout
Note: Only forHttpClient
, not forOKHttpClient
.- Parameters:
connectionTimeout
-- Returns:
-
getReadTimeout
public int getReadTimeout()Gets the read timeout.- Returns:
-
setReadTimeout
Note: Only forHttpClient
, not forOKHttpClient
.- Parameters:
readTimeout
-- Returns:
-
getSSLSocketFactory
Gets the SSL socket factory.- Returns:
-
setSSLSocketFactory
Sets the SSL socket factory.- Parameters:
sslSocketFactory
-- Returns:
-
getUseCaches
public boolean getUseCaches()Gets the use caches.- Returns:
-
setUseCaches
Note: Only forHttpClient
, not forOKHttpClient
.- Parameters:
useCaches
-- Returns:
-
doInput
public boolean doInput()- Returns:
- true, if successful
- See Also:
-
doInput
Note: Only forHttpClient
, not forOKHttpClient
.- Parameters:
doInput
-- Returns:
- See Also:
-
doOutput
public boolean doOutput()- Returns:
- true, if successful
- See Also:
-
doOutput
Note: Only forHttpClient
, not forOKHttpClient
.- Parameters:
doOutput
-- Returns:
- See Also:
-
isOneWayRequest
public boolean isOneWayRequest()Checks if is one way request.- Returns:
- true, if is one way request
-
isOneWayRequest
Checks if is one way request.- Parameters:
isOneWayRequest
-- Returns:
-
getContentFormat
Gets the content format.- Returns:
-
setContentFormat
Sets the content format.- Parameters:
contentFormat
-- Returns:
-
setContentType
-
getContentType
-
setContentEncoding
-
getContentEncoding
-
basicAuth
- Parameters:
user
-password
-- Returns:
-
header
Set http header specified byname/value
. If thisHttpSettings
already has any headers with that name, they are all replaced.- Parameters:
name
-value
-- Returns:
-
headers
Set http headers specified byname1/value1
,name2/value2
. If thisHttpSettings
already has any headers with that name, they are all replaced.- Parameters:
name1
-value1
-name2
-value2
-- Returns:
-
headers
public HttpSettings headers(String name1, Object value1, String name2, Object value2, String name3, Object value3) Set http headers specified byname1/value1
,name2/value2
,name3/value3
. If thisHttpSettings
already has any headers with that name, they are all replaced.- Parameters:
name1
-value1
-name2
-value2
-name3
-value3
-- Returns:
-
headers
Set http headers specified by the key/value entities fromMap
. If thisHttpSettings
already has any headers with that name, they are all replaced.- Parameters:
headers
-- Returns:
-
headers
Removes all headers on thisHttpSettings
and addsheaders
.- Parameters:
headers
-- Returns:
-
headers
-
copy
-
toString
-