public interface RequestSpec
Modifier and Type | Interface and Description |
---|---|
static interface |
RequestSpec.Body
The request body.
|
Modifier and Type | Method and Description |
---|---|
RequestSpec |
body(Action<? super RequestSpec.Body> action)
Executes the given action with the
request body . |
RequestSpec.Body |
getBody()
The body of the request, used for specifying the body content.
|
MutableHeaders |
getHeaders() |
HttpUrlSpec |
getUrl() |
RequestSpec |
headers(Action<? super MutableHeaders> action)
This method can be used to compose changes to the headers.
|
RequestSpec |
method(String method)
Set the HTTP verb to use.
|
RequestSpec |
url(Action<? super HttpUrlSpec> action) |
MutableHeaders getHeaders()
MutableHeaders
that can be used to configure the headers that will be used for the request.RequestSpec headers(Action<? super MutableHeaders> action) throws Exception
action
- Provide an action that will act on MutableHeaders.Exception
- This can be thrown from the action supplied.RequestSpec method(String method)
method
- which HTTP verb to useHttpUrlSpec getUrl()
RequestSpec url(Action<? super HttpUrlSpec> action) throws Exception
Exception
RequestSpec.Body getBody()
RequestSpec body(Action<? super RequestSpec.Body> action) throws Exception
request body
.
This method is a “fluent API” alternative to getBody()
.
action
- configuration of the request bodyException
- any thrown by action