ResultT
- The type of the result entity, if any.public interface RequestBuilder<ResultT>
Modifier and Type | Method and Description |
---|---|
ResultT |
execute(HttpDestinationProperties destination)
Execute the OData request.
|
ODataRequestGeneric |
toRequest()
Assemble a generic, untyped request object that represents the request build up via this builder.
|
default io.vavr.control.Try<ResultT> |
tryExecute(HttpDestinationProperties destination)
Safely execute the OData request.
|
RequestBuilder<ResultT> |
withHeader(String key,
String value)
Gives the option to specify custom HTTP headers.
|
RequestBuilder<ResultT> |
withHeaders(Map<String,String> map)
Gives the option to specify a map of custom HTTP headers.
|
@Nonnull ResultT execute(@Nonnull HttpDestinationProperties destination)
destination
- The destination to be used as request target.DestinationAccessException
- If there is an issue accessing the Destination
.HttpClientInstantiationException
- If there is an issue creating the HttpClient
.ODataException
- If the OData request execution failed. Please find the documentation for ODataException
possible sub-types and error scenarios they can occur in.@Nonnull default io.vavr.control.Try<ResultT> tryExecute(@Nonnull HttpDestinationProperties destination)
destination
- The destination to be used as request target.Try
block.@Nonnull @Beta ODataRequestGeneric toRequest()
ODataRequestGeneric
.@Nonnull RequestBuilder<ResultT> withHeader(@Nonnull String key, @Nullable String value)
key
- Name of the (first) desired HTTP header parameter.value
- Value of the (first) desired HTTP header parameter.@Nonnull RequestBuilder<ResultT> withHeaders(@Nonnull Map<String,String> map)
map
- A map of HTTP header key/value pairs.Copyright © 2020 SAP SE. All rights reserved.