Interface HttpService
- All Superinterfaces:
Service
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isLocalHttpRequestAllowed
(RequestContextUserType requestContextUserType) Indicates whether local access is available for the providedRequestContextUserType
.newHttpRequest
(String connectionName) Deprecated.as of 24R1.1, replaced by {@link #newHttpRequestBuilder().withConnectionName()}.Create aFormHttpRequest.Builder
forFormHttpRequest
Deprecated.as of 22R3.4, replaced bynewLocalHttpRequest(RequestContextUserType)
.newLocalHttpRequest
(RequestContextUserType requestContextUserType) Deprecated.as of 24R1.1, replaced by {@link #newHttpRequestBuilder().withLocalConnection(RequestContextUserType}.send
(HttpRequest httpRequest, CsvReadParameters csvReadParameters) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, CsvReadParameters)
<T> HttpOperation<T>
send
(HttpRequest httpRequest, HttpResponseBodyValueType<T> valueType) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, HttpResponseBodyValueType)
<U extends UserDefinedModel>
HttpOperation<U>send
(HttpRequest httpRequest, Class<U> userDefinedModelResponseType) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, Class)
sendRequest
(HttpWebRequest httpRequest, CsvReadParameters csvReadParameters) Creates an operation to send the specified HTTP request and convert the response body specifically toCsvData
using the given customcsvReadParameters
.<T> HttpOperation<T>
sendRequest
(HttpWebRequest httpRequest, HttpResponseBodyValueType<T> valueType) Creates an operation to send the specified HTTP request and convert the response body to the givenvalueType
.<U extends UserDefinedModel>
HttpOperation<U>sendRequest
(HttpWebRequest httpRequest, Class<U> userDefinedModelResponseType) Creates an operation to send the specified HTTP request and convert the response body to the givenUserDefinedModel
type.
-
Method Details
-
newLocalHttpRequest
Deprecated.as of 22R3.4, replaced bynewLocalHttpRequest(RequestContextUserType)
.Create a new HTTP request to represent a connection to the current Vault as the current user.- Returns:
- local HTTP request
-
isLocalHttpRequestAllowed
Indicates whether local access is available for the providedRequestContextUserType
. If true, the user type can create local HTTP requests.- Parameters:
requestContextUserType
- the user type to check access for- Returns:
- true if local access is available for the provided user type
-
newLocalHttpRequest
Deprecated.as of 24R1.1, replaced by {@link #newHttpRequestBuilder().withLocalConnection(RequestContextUserType}.Create a new HTTP request to represent a connection to the current vault as the provided user type. If it is unclear whether the local request will succeed for the provided user type, call theisLocalHttpRequestAllowed(RequestContextUserType)
method prior to calling this method.- Parameters:
requestContextUserType
- user type establishing the HTTP request- Returns:
- local HTTP request
-
newHttpRequest
Deprecated.as of 24R1.1, replaced by {@link #newHttpRequestBuilder().withConnectionName()}.Create a new HTTP request corresponding to the givenconnectionName
(local, Vault to Vault, or external connection).- 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:
- HttpRequest
-
newHttpRequestBuilder
FormHttpRequest.Builder newHttpRequestBuilder()Create aFormHttpRequest.Builder
forFormHttpRequest
- Returns:
- FormHttpRequest.Builder
-
send
@Deprecated <T> HttpOperation<T> send(HttpRequest httpRequest, HttpResponseBodyValueType<T> valueType) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, HttpResponseBodyValueType)
Creates an operation to send the specified HTTP request and convert the response body to the givenvalueType
.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, STRING).ignoreError().execute()
- Type Parameters:
T
- HTTP response body type- Parameters:
httpRequest
- HTTP request to execute. Cannot be null.valueType
- the type to which response body must be converted to. Cannot be null.- Returns:
- an operation used to execute the HTTP request
-
sendRequest
<T> HttpOperation<T> sendRequest(HttpWebRequest httpRequest, HttpResponseBodyValueType<T> valueType) Creates an operation to send the specified HTTP request and convert the response body to the givenvalueType
.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, STRING).ignoreError().execute()
- Type Parameters:
T
- HTTP response body type- Parameters:
httpRequest
- HTTP request to execute. for example, FormHttpRequest, Cannot be null.valueType
- the type to which response body must be converted to. Cannot be null.- Returns:
- an operation used to execute the HTTP request
-
send
@Deprecated HttpOperation<CsvData> send(HttpRequest httpRequest, CsvReadParameters csvReadParameters) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, CsvReadParameters)
Creates an operation to send the specified HTTP request and convert the response body specifically toCsvData
using the given customcsvReadParameters
.If there is no need to customize
CsvReadParameters
, you may simply usesend(HttpRequest, HttpResponseBodyValueType)
.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, csvReadParameters).ignoreError().execute()
- Parameters:
httpRequest
- httpRequest to execute. Cannot be null.csvReadParameters
- custom CSV read parameters to use to convert response body toCsvData
. Cannot be null.- Returns:
- an operation used to execute HTTP request
-
send
@Deprecated <U extends UserDefinedModel> HttpOperation<U> send(HttpRequest httpRequest, Class<U> userDefinedModelResponseType) Deprecated.as of 24R1.1, replaced bysendRequest(HttpWebRequest, Class)
Creates an operation to send the specified HTTP request and convert the response body to the givenUserDefinedModel
type. The response body's content type is expected to be JSON when using this method, because this is currently the only content type that is supported by User-Defined Models.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, STRING).ignoreError().execute()
- Type Parameters:
U
- type of UserDefinedModel- Parameters:
httpRequest
- HTTP request to execute. Cannot be null.userDefinedModelResponseType
- the User-Defined-Model class to which response body must be converted to. Cannot be null.- Returns:
- an operation used to execute the HTTP request
-
sendRequest
Creates an operation to send the specified HTTP request and convert the response body specifically toCsvData
using the given customcsvReadParameters
.If there is no need to customize
CsvReadParameters
, you may simply usesendRequest(HttpWebRequest, HttpResponseBodyValueType)
.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, csvReadParameters).ignoreError().execute()
- Parameters:
httpRequest
- httpRequest to execute. for example, FormHttpRequest, Cannot be null.csvReadParameters
- custom CSV read parameters to use to convert response body toCsvData
. Cannot be null.- Returns:
- an operation used to execute HTTP request
-
sendRequest
<U extends UserDefinedModel> HttpOperation<U> sendRequest(HttpWebRequest httpRequest, Class<U> userDefinedModelResponseType) Creates an operation to send the specified HTTP request and convert the response body to the givenUserDefinedModel
type. The response body's content type is expected to be JSON when using this method, because this is currently the only content type that is supported by User-Defined Models.You can specify the ways success and error are handled on the returned
HttpOperation
. Once success-handling and error-handling is specified, you can callHttpOperation.execute()
to send the HTTP request. For example:httpService.send(httpRequest, STRING).ignoreError().execute()
- Type Parameters:
U
- type of UserDefinedModel- Parameters:
httpRequest
- HTTP request to execute. for example, FormHttpRequest, Cannot be null.userDefinedModelResponseType
- the User-Defined-Model class to which response body must be converted to. Cannot be null.- Returns:
- an operation used to execute the HTTP request
-