public interface IHttpClient
IPublicClientApplication or
IConfidentialClientApplication.
MSAL Java uses HTTP to communicate with the Microsoft identity platform for authentication and token acquisition. By default, MSAL uses the JDK's HttpURLConnection, but this interface allows applications to provide their own HTTP client implementation. This is useful when:
For more details, see https://aka.ms/msal4j-http-client
| Modifier and Type | Method and Description |
|---|---|
IHttpResponse |
send(HttpRequest httpRequest)
Executes an outgoing HTTP request using the HTTP client implementation of choice.
|
IHttpResponse send(HttpRequest httpRequest) throws Exception
This method should handle all the details of making the HTTP request and adapting
the response to the IHttpResponse interface. The implementation should also
include appropriate error handling for network-related issues.
httpRequest - The HttpRequest containing details of the request to execute,
including URL, headers, HTTP method, and body.IHttpResponse object containing the status code, headers, and body of the response.Exception - Non-recoverable exceptions that cannot be handled by the HTTP client implementation.
Note that recoverable errors (e.g., retryable HTTP status codes, transient
network issues) should be handled by the implementation itself.Copyright © 2013–2025. All rights reserved.