Interface Configurer.Connection
-
- Enclosing interface:
- Configurer
public static interface Configurer.Connection
Represents actions doable on a connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,List<String>>
getHeaders()
String
getMethod()
byte[]
getPayload()
String
getUrl()
Configurer.Connection
withConnectionTimeout(int timeout)
Sets the connection timeout of the connection.Configurer.Connection
withHeader(String name, String value)
Adds a header to the request.Configurer.Connection
withoutFollowRedirects()
Prevents the client to follow redirections.Configurer.Connection
withReadTimeout(int timeout)
Sets the read timeout of the connection.
-
-
-
Method Detail
-
getHeaders
Map<String,List<String>> getHeaders()
- Returns:
- headers already set.
-
getPayload
byte[] getPayload()
- Returns:
- payload of the request or null.
-
withHeader
Configurer.Connection withHeader(String name, String value)
Adds a header to the request.- Parameters:
name
- header name.value
- header value.- Returns:
- current connection.
-
withReadTimeout
Configurer.Connection withReadTimeout(int timeout)
Sets the read timeout of the connection.- Parameters:
timeout
- timeout value in milliseconds.- Returns:
- current connection.
-
withConnectionTimeout
Configurer.Connection withConnectionTimeout(int timeout)
Sets the connection timeout of the connection.- Parameters:
timeout
- timeout value in milliseconds.- Returns:
- current connection.
-
withoutFollowRedirects
Configurer.Connection withoutFollowRedirects()
Prevents the client to follow redirections.- Returns:
- connection.
-
-