public interface HttpRequest
Modifier and Type | Method and Description |
---|---|
HttpRequest |
appendPath(String path)
Appends the given path to the base URL.
|
HttpRequest |
setBody(CsvData body)
Specifies request body as CSV as returned by
CsvData.asString() . |
HttpRequest |
setBody(JsonArray body)
Specifies request body as JSON as returned by
JsonArray.asString() . |
HttpRequest |
setBody(JsonObject body)
Specifies request body as JSON as returned by
JsonObject.asString() . |
HttpRequest |
setBody(String body)
Specifies request body as a string.
|
HttpRequest |
setBodyParam(String name,
String value)
Specifies a body param.
|
HttpRequest |
setHeader(String name,
String value)
Specifies an HTTP request header.
|
HttpRequest |
setMethod(HttpMethod method)
Specifies the HTTP method of the request.
|
HttpRequest |
setQuerystringParam(String name,
String value)
Specifies a query string param.
|
HttpRequest |
setResolveTokens(boolean resolveTokens)
Specifies whether or not to resolve tokens used in headers, body parameters, and body.
|
HttpRequest |
setTimeout(int timeout)
Specifies the maximum time in milliseconds to wait for this HTTP request to complete execution.
|
HttpRequest setMethod(HttpMethod method)
setBody
method default to
POST
and all other requests default to GET
.method
- HTTP methodHttpRequest setHeader(String name, String value)
Each call with the same name adds to the List of already specified values.
name
- header name. Cannot be null or empty.value
- header value. Cannot be null.HttpRequest appendPath(String path)
path
- path to append. Cannot be null.HttpRequest setQuerystringParam(String name, String value)
name
- query string param name. Cannot be null or empty.value
- query string param value. Cannot be null.HttpRequest setBodyParam(String name, String value)
Content-Type: application/x-www-form-urlencoded; charset=utf-8
.name
- body param name. Cannot be null or empty.value
- body param value. Cannot be null.HttpRequest setBody(String body)
Content-Type: application/x-www-form-urlencoded; charset=utf-8
.body
- request body. Cannot be null.HttpRequest setBody(CsvData body)
CsvData.asString()
.
Header defaults to Content-Type: text/csv; charset=utf-8
.body
- request body. Cannot be null.HttpRequest setBody(JsonObject body)
JsonObject.asString()
.
Header defaults to Content-Type: application/json; charset=utf-8
.body
- request body. Cannot be null.HttpRequest setBody(JsonArray body)
JsonArray.asString()
.
Header defaults to Content-Type: application/json; charset=utf-8
.body
- request body. Cannot be null.HttpRequest setTimeout(int timeout)
timeout
- timeout in millisecondsHttpRequest setResolveTokens(boolean resolveTokens)
By default, tokens are not resolved. You must call this method to resolve tokens.
resolveTokens
- true if tokens have to be resolved, otherwise falseCopyright © Veeva Systems 2017–2019. All rights reserved.