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