The response headers as key-value pairs (values can be string or string array)
The response body (either parsed JSON object or original string)
The HTTP method used for the request
The path or URL that was requested
The HTTP status code returned by the server
Return type definition for the HttpError.toJSON method
This interface provides a structured representation of all HTTP error information in a format suitable for serialization, logging, debugging, and API responses. It ensures consistency across different parts of an application when handling HTTP errors.
The generic type parameter
T
allows for type-safe access to the parsed response body when the structure is known at compile time.Example