Interface Request
-
- All Implemented Interfaces:
public interface Request
-
-
Method Summary
Modifier and Type Method Description abstract StringgetMethod()The HTTP method for this request. abstract StringgetUrl()The URL to perform this request on. abstract Map<String, String>getParams()The URL parameters to use for this request. abstract Map<String, String>getHeaders()The headers to use for this request. abstract ObjectgetData()The data for the body of this request. abstract ObjectgetJson()An object to use as the JSON payload for this request. abstract AuthorizationgetAuth()The HTTP basic auth username and password. abstract Map<String, String>getCookies()A Map of cookies to send with this request. abstract DoublegetTimeout()The amount of time to wait, in seconds, for the server to send data. abstract BooleangetAllowRedirects()If redirects should be followed. abstract BooleangetStream()If the response content should be immediately downloaded ( false) or streamed (true).abstract List<FileLike>getFiles()List of FileLike objects to include in the request. abstract ByteArraygetBody()The body of the request to be sent. abstract SSLContextgetSslContext()SSL configuration for the request abstract HostnameVerifiergetHostnameVerifier()URL's hostname and the server's identification hostname validation -
-
Method Detail
-
getHeaders
abstract Map<String, String> getHeaders()
The headers to use for this request.
-
getJson
abstract Object getJson()
An object to use as the JSON payload for this request. Some special things happen if this isn't
null.If this is not
null,whatever is specified in data will be overwritten
the
Content-Typeheader becomesapplication/jsonthe object specified is coerced into either a JSONArray or a JSONObject
JSONObjects and JSONArrays are treated as such and will not undergo coercion
Maps become JSONObjects by using the appropriate constructor. Keys are converted to Strings, with
nullbecoming"null"Collections becomes JSONArrays by using the appropriate constructor.
Arrays become JSONArrays by using the appropriate constructor.
any other Iterables becomes JSONArrays using a custom method.
any other object throws an IllegalArgumentException
-
getAuth
abstract Authorization getAuth()
The HTTP basic auth username and password.
-
getCookies
abstract Map<String, String> getCookies()
A Map of cookies to send with this request. Note that CookieJar is a map. It also has a constructor that takes a map, for easy conversion.
-
getTimeout
abstract Double getTimeout()
The amount of time to wait, in seconds, for the server to send data.
-
getAllowRedirects
abstract Boolean getAllowRedirects()
If redirects should be followed.
-
getStream
abstract Boolean getStream()
If the response content should be immediately downloaded (
false) or streamed (true).
-
getSslContext
abstract SSLContext getSslContext()
SSL configuration for the request
-
getHostnameVerifier
abstract HostnameVerifier getHostnameVerifier()
URL's hostname and the server's identification hostname validation
-
-
-
-