Interface HttpResponseMessage

All Known Implementing Classes:
Accepted, Accepted.Unmodifiable, AlreadyReported, AlreadyReported.Unmodifiable, ArgException, AuthenticationException, BadGateway, BadGateway.Unmodifiable, BadRequest, BadRequest.Unmodifiable, BasicHttpException, BasicHttpException.Unmodifiable, BasicHttpResponse, Conflict, Conflict.Unmodifiable, Continue, Continue.Unmodifiable, Created, Created.Unmodifiable, EarlyHints, EarlyHints.Unmodifiable, ExpectationFailed, ExpectationFailed.Unmodifiable, FailedDependency, FailedDependency.Unmodifiable, Forbidden, Forbidden.Unmodifiable, Found, Found.Unmodifiable, GatewayTimeout, GatewayTimeout.Unmodifiable, Gone, Gone.Unmodifiable, HttpVersionNotSupported, HttpVersionNotSupported.Unmodifiable, IMUsed, IMUsed.Unmodifiable, InsufficientStorage, InsufficientStorage.Unmodifiable, InternalServerError, InternalServerError.Unmodifiable, LengthRequired, LengthRequired.Unmodifiable, Locked, Locked.Unmodifiable, LoopDetected, LoopDetected.Unmodifiable, MethodNotAllowed, MethodNotAllowed.Unmodifiable, MisdirectedRequest, MisdirectedRequest.Unmodifiable, MovedPermanently, MovedPermanently.Unmodifiable, MultipleChoices, MultipleChoices.Unmodifiable, MultiStatus, MultiStatus.Unmodifiable, NetworkAuthenticationRequired, NetworkAuthenticationRequired.Unmodifiable, NoContent, NoContent.Unmodifiable, NonAuthoritativeInformation, NonAuthoritativeInformation.Unmodifiable, NotAcceptable, NotAcceptable.Unmodifiable, NotExtended, NotExtended.Unmodifiable, NotFound, NotFound.Unmodifiable, NotImplemented, NotImplemented.Unmodifiable, NotModified, NotModified.Unmodifiable, Ok, Ok.Unmodifiable, PartialContent, PartialContent.Unmodifiable, PayloadTooLarge, PayloadTooLarge.Unmodifiable, PermanentRedirect, PermanentRedirect.Unmodifiable, PreconditionFailed, PreconditionFailed.Unmodifiable, PreconditionRequired, PreconditionRequired.Unmodifiable, Processing, Processing.Unmodifiable, RangeNotSatisfiable, RangeNotSatisfiable.Unmodifiable, RequestHeaderFieldsTooLarge, RequestHeaderFieldsTooLarge.Unmodifiable, ResetContent, ResetContent.Unmodifiable, SeeOther, SeeOther.Unmodifiable, SeeOtherRoot, SeriesAggregator.RequestException, ServiceUnavailable, ServiceUnavailable.Unmodifiable, SwitchingProtocols, SwitchingProtocols.Unmodifiable, TemporaryRedirect, TemporaryRedirect.Unmodifiable, TooManyRequests, TooManyRequests.Unmodifiable, Unauthorized, Unauthorized.Unmodifiable, UnavailableForLegalReasons, UnavailableForLegalReasons.Unmodifiable, UnprocessableEntity, UnprocessableEntity.Unmodifiable, UnsupportedMediaType, UnsupportedMediaType.Unmodifiable, UpgradeRequired, UpgradeRequired.Unmodifiable, UriTooLong, UriTooLong.Unmodifiable, UseProxy, UseProxy.Unmodifiable, ValidationException, VariantAlsoNegotiates, VariantAlsoNegotiates.Unmodifiable

public interface HttpResponseMessage
A complete HTTP response message: status line, headers, and optional body.

Mirrors the semantics of org.apache.http.HttpResponse without the Apache HttpCore dependency.

See Also:
Since:
9.2.1
  • Method Details

    • getStatusLine

      Returns the status line of this response.
      Returns:
      The status line. Never null.
    • getHeaders

      Returns all response headers, in the order they were received.
      Returns:
      An unmodifiable list of response headers. Never null.
    • getFirstHeader

      Returns the first response header with the given name (case-insensitive), or null if absent.
      Parameters:
      name - The header name. Must not be null.
      Returns:
      The first matching header, or null if absent.
    • getHeaders

      default List<HttpHeader> getHeaders(String name)
      Returns all response headers with the given name (case-insensitive).
      Parameters:
      name - The header name. Must not be null.
      Returns:
      A list of matching headers (possibly empty). Never null.
    • getBody

      Returns the response body, or null if the response has no body.
      Returns:
      The response body, possibly null.