Package com.microsoft.graph.http
Interface IHttpProvider<nativeRequestType>
- Type Parameters:
nativeRequestType- type of a request for the native http client
- All Known Implementing Classes:
CoreHttpProvider
public interface IHttpProvider<nativeRequestType>
Sends HTTP requests
-
Method Summary
Modifier and TypeMethodDescription<Result,BodyType>
nativeRequestTypegetHttpRequest(IHttpRequest request, Class<Result> resultClass, BodyType serializable) Sends the HTTP requestGet the serializer for this HTTP provider<Result,BodyType>
Resultsend(IHttpRequest request, Class<Result> resultClass, BodyType serializable) Sends the HTTP request<Result,BodyType, DeserializeType>
Resultsend(IHttpRequest request, Class<Result> resultClass, BodyType serializable, IStatefulResponseHandler<Result, DeserializeType> handler) Sends the HTTP request<Result,BodyType>
CompletableFuture<Result>sendAsync(IHttpRequest request, Class<Result> resultClass, BodyType serializable) Sends the HTTP request asynchronously<Result,BodyType, DeserializeType>
CompletableFuture<Result>sendAsync(IHttpRequest request, Class<Result> resultClass, BodyType serializable, IStatefulResponseHandler<Result, DeserializeType> handler) Sends the HTTP request
-
Method Details
-
getSerializer
Get the serializer for this HTTP provider- Returns:
- the serializer for this provider
-
sendAsync
@Nonnull <Result,BodyType> CompletableFuture<Result> sendAsync(@Nonnull IHttpRequest request, @Nonnull Class<Result> resultClass, @Nullable BodyType serializable) Sends the HTTP request asynchronously- Type Parameters:
Result- the type of the response objectBodyType- the type of the object to send to the service in the body of the request- Parameters:
request- the request descriptionresultClass- the class of the response from the serviceserializable- the object to send to the service in the body of the request- Returns:
- a future with the result
-
sendAsync
@Nullable <Result,BodyType, CompletableFuture<Result> sendAsyncDeserializeType> (@Nonnull IHttpRequest request, @Nonnull Class<Result> resultClass, @Nullable BodyType serializable, @Nonnull IStatefulResponseHandler<Result, DeserializeType> handler) throws ClientExceptionSends the HTTP request- Type Parameters:
Result- the expected return type returnBodyType- the type of the object to send to the service in the body of the requestDeserializeType- the type of the HTTP response object- Parameters:
request- the request descriptionresultClass- the class of the response from the serviceserializable- the object to send to the service in the body of the requesthandler- the handler for stateful response- Returns:
- a future with the result
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
send
@Nullable <Result,BodyType> Result send(@Nonnull IHttpRequest request, @Nonnull Class<Result> resultClass, @Nullable BodyType serializable) throws ClientException Sends the HTTP request- Type Parameters:
Result- the type of the response objectBodyType- the type of the object to send to the service in the body of the request- Parameters:
request- the request descriptionresultClass- the class of the response from the serviceserializable- the object to send to the service in the body of the request- Returns:
- the result from the request
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
send
@Nullable <Result,BodyType, Result sendDeserializeType> (@Nonnull IHttpRequest request, @Nonnull Class<Result> resultClass, @Nullable BodyType serializable, @Nonnull IStatefulResponseHandler<Result, DeserializeType> handler) throws ClientExceptionSends the HTTP request- Type Parameters:
Result- the expected return type returnBodyType- the type of the object to send to the service in the body of the requestDeserializeType- the type of the HTTP response object- Parameters:
request- the request descriptionresultClass- the class of the response from the serviceserializable- the object to send to the service in the body of the requesthandler- the handler for stateful response- Returns:
- the expected result object for the request
- Throws:
ClientException- this exception occurs if the request was unable to complete for any reason
-
getHttpRequest
@Nullable <Result,BodyType> nativeRequestType getHttpRequest(@Nonnull IHttpRequest request, @Nonnull Class<Result> resultClass, @Nullable BodyType serializable) throws ClientException Sends the HTTP request- Type Parameters:
Result- the type of the response objectBodyType- the type of the object to send to the service in the body of the request- Parameters:
request- the request descriptionresultClass- the class of the response from the serviceserializable- the object to send to the service in the body of the request- Returns:
- the result from the request
- Throws:
ClientException- an exception occurs if the request was unable to complete for any reason
-