public static class HttpRequest.Builder extends Object
HttpRequests.| Constructor and Description |
|---|
Builder()
Constructs a new builder for an HTTP request.
|
| Modifier and Type | Method and Description |
|---|---|
HttpRequest |
build()
Builds, validates, and returns the
HttpRequest. |
HttpRequest.Builder |
withAuthUrl(String authUrl)
Sets the URL that will be used to capture cookies for authentication before the
actual request is executed.
|
HttpRequest.Builder |
withBody(Object body)
Sets the body that will be included in the request.
|
HttpRequest.Builder |
withCookies(Map<String,String> cookies)
Sets the cookies that will be included in the request.
|
HttpRequest.Builder |
withEncodeBodyAsJson(Boolean encodeBodyAsJson)
Sets whether or not the included body should be encoded as extended JSON when sent to the
url in this request.
|
HttpRequest.Builder |
withFollowRedirects(Boolean followRedirects)
Sets whether or not Stitch should follow redirects while executing the request.
|
HttpRequest.Builder |
withForm(Map<String,String> form)
Sets the form that will be included in the request.
|
HttpRequest.Builder |
withHeaders(Map<String,Collection<String>> headers)
Sets the headers that will be included in the request.
|
HttpRequest.Builder |
withMethod(HttpMethod method)
Sets the HTTP method of the request.
|
HttpRequest.Builder |
withUrl(String url)
Sets the URL that the request will be performed against.
|
public HttpRequest.Builder withUrl(String url)
url - the URL that the request will be performed against.public HttpRequest.Builder withMethod(HttpMethod method)
method - the HTTP method of the request.public HttpRequest.Builder withAuthUrl(String authUrl)
authUrl - the URL that will be used to capture cookies for authentication before the
actual request is executed.public HttpRequest.Builder withHeaders(Map<String,Collection<String>> headers)
headers - the headers that will be included in the request.public HttpRequest.Builder withCookies(Map<String,String> cookies)
cookies - the cookies that will be included in the request.public HttpRequest.Builder withBody(Object body)
String or a Binary or else
the request will fail when executed on Stitch.body - the body that will be included in the request.public HttpRequest.Builder withEncodeBodyAsJson(Boolean encodeBodyAsJson)
encodeBodyAsJson - whether or not the included body should be encoded as extended JSON
when sent to the url in this request.withBodypublic HttpRequest.Builder withForm(Map<String,String> form)
form - the form that will be included in the request.public HttpRequest.Builder withFollowRedirects(Boolean followRedirects)
followRedirects - whether or not Stitch should follow redirects while executing the
request. Defaults to false.public HttpRequest build()
HttpRequest.