Package com.veeva.vault.sdk.api.http
Interface HttpWebRequest.Builder<B extends HttpWebRequest.Builder>
- All Known Subinterfaces:
FormHttpRequest.Builder
- Enclosing interface:
- HttpWebRequest
public static interface HttpWebRequest.Builder<B extends HttpWebRequest.Builder>
-
Method Summary
Modifier and TypeMethodDescriptionwithConnectionName
(String connectionName) Specify aconnectionName
(local, Vault to Vault, or external connection).withHeader
(String name, String value) Specifies an HTTP request header.withLocalConnection
(RequestContextUserType requestContextUserType) Specify aRequestContextUserType
to represent a local connection to the current vault as the provided user type.withMethod
(HttpMethod method) Specifies the HTTP method of the request.Appends the given path to the base URL.withQuerystringParam
(String name, String value) Specifies a query string param.withResolveTokens
(boolean resolveTokens) Specifies whether to resolve tokens used in headers, body parameters, and body.withTimeout
(int timeout) Specifies the maximum time in milliseconds to wait for this HTTP request to complete execution.withTokenRequest
(TokenRequest tokenRequest) Specifies the custom tokens that should be resolved in headers, body parameters, and body.
-
Method Details
-
withMethod
Specifies the HTTP method of the request. If not specified, requests with asetBody
method default toPOST
and all other requests default toGET
.- Parameters:
method
- HTTP method- Returns:
- this B
-
withHeader
Specifies an HTTP request header. Each call with the same name adds to the List of already specified values. Use only the following request headers withwithHeader
:Content-Type
: See theHttpRequestContentType
for supported content types.Authorization
: Pass the currentsessionId
on REST API calls. Learn more about Session IDs in the Developer Portal.X-VaultAPI-ClientID
: Pass a client ID with this request. Learn more about client IDs in the Developer Portal.
- Parameters:
name
- header name. Cannot be null or empty.value
- header value. Cannot be null.- Returns:
- this B
-
withPath
Appends the given path to the base URL.- Parameters:
path
- path to append. Cannot be null.- Returns:
- this B
-
withQuerystringParam
Specifies a query string param.- Parameters:
name
- query string param name. Cannot be null or empty.value
- query string param value. Cannot be null.- Returns:
- this B
-
withTimeout
Specifies the maximum time in milliseconds to wait for this HTTP request to complete execution. Must be greater than 0.- Parameters:
timeout
- timeout in milliseconds- Returns:
- this B
-
withTokenRequest
Specifies the custom tokens that should be resolved in headers, body parameters, and body.For these tokens to be resolved, token resolution must be enabled with
withResolveTokens(boolean)
.- Parameters:
tokenRequest
- , the token request containing the mapping from token names to their values. Cannot be null.- Returns:
- this B
-
withResolveTokens
Specifies whether to resolve tokens used in headers, body parameters, and body. Tokens used in query string parameters are not resolved.By default, tokens are not resolved. You must call this method to resolve tokens.
- Parameters:
resolveTokens
- true if tokens have to be resolved, otherwise false- Returns:
- this B
-
withConnectionName
Specify aconnectionName
(local, Vault to Vault, or external connection). EitherconnectionName
orrequestContextUserType
is required to create a Http request- Parameters:
connectionName
- name of a local, Vault to Vault, or external connection. Must be a connection with "active" lifecycle state. Cannot be null or empty.- Returns:
- this B
-
withLocalConnection
Specify aRequestContextUserType
to represent a local connection to the current vault as the provided user type. EitherrequestContextUserType
orconnectionName
is required to create a Http request- Parameters:
requestContextUserType
-- Returns:
- this B
-