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 HttpClientCreates a newHttpClientinstance.static HttpClientcreateDefault(HttpClientOptions clientOptions) Creates a newHttpClientinstance.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 HttpResponsesendSync(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
Monothat 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
Monothat 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 newHttpClientinstance.- Returns:
- A new
HttpClientinstance.
-
createDefault
Creates a newHttpClientinstance.- Parameters:
clientOptions- Configuration options applied to the createdHttpClient.- Returns:
- A new
HttpClientinstance.
-