Package com.azure.core.http
Interface HttpClient
public interface HttpClient
A generic interface for sending HTTP requests and getting responses.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpClient
Creates a newHttpClient
instance.static HttpClient
createDefault
(HttpClientOptions clientOptions) Creates a newHttpClient
instance.send
(HttpRequest request) Send the provided request asynchronously.default Mono<HttpResponse>
send
(HttpRequest request, Context context) Sends the provided request asynchronously with contextual information.default HttpResponse
sendSync
(HttpRequest request, Context context) Sends the provided request synchronously with contextual information.
-
Method Details
-
send
Send the provided request asynchronously.- Parameters:
request
- The HTTP request to send.- Returns:
- A
Mono
that emits the response asynchronously.
-
send
Sends the provided request asynchronously with contextual information.- Parameters:
request
- The HTTP request to send.context
- Contextual information about the request.- Returns:
- A
Mono
that emits the response asynchronously.
-
sendSync
Sends the provided request synchronously with contextual information.- Parameters:
request
- The HTTP request to send.context
- Contextual information about the request.- Returns:
- The response.
-
createDefault
Creates a newHttpClient
instance.- Returns:
- A new
HttpClient
instance.
-
createDefault
Creates a newHttpClient
instance.- Parameters:
clientOptions
- Configuration options applied to the createdHttpClient
.- Returns:
- A new
HttpClient
instance.
-