IHttpResponse Interface

public interface IHttpResponse

Represents an HTTP response returned after executing a HttpRequest through an IHttpClient implementation. This interface encapsulates all the data returned by the authentication service or other HTTP endpoints contacted during the authentication flows.

Custom implementations of IHttpClient must convert their native HTTP response objects to this interface.

Method Summary

Modifier and Type Method and Description
abstract java.lang.String body()

Gets the HTTP response body.

abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers()

Gets the HTTP response headers.

abstract int statusCode()

Gets the HTTP response status code.

Method Details

body

public abstract String body()

Gets the HTTP response body.

Returns:

The body of the HTTP response as a string. For responses from the Microsoft identity platform, this is typically JSON content containing tokens or error information.

headers

public abstract Map<String,List<String>> headers()

Gets the HTTP response headers.

Returns:

A map of HTTP header names to their values. If a header appears multiple times, its values are collected in a list. Header names are typically case-insensitive as per HTTP specification.

statusCode

public abstract int statusCode()

Gets the HTTP response status code.

Returns:

HTTP response status code. Common values include 200 (OK), 400 (Bad Request), 401 (Unauthorized), and 500 (Internal Server Error).

Applies to