Class RawResponse

java.lang.Object
co.cryptoservice.sdk.RawResponse

public final class RawResponse extends Object
The answer to CryptoServiceClient.request(java.lang.String, java.lang.String, byte[], java.lang.String), whatever its status: the low-level escape hatch for routes the typed methods do not cover.
  • Method Details

    • status

      public int status()
      The HTTP status.
      Returns:
      the status, 2xx or not
    • headers

      public HttpHeaders headers()
      The response headers.
      Returns:
      the headers
    • mediaType

      public Optional<String> mediaType()
      The Content-Type without parameters, lower-cased.
      Returns:
      for example application/json, or empty when there is none
    • body

      public byte[] body()
      The body.
      Returns:
      a copy of the body bytes
    • bodyText

      public String bodyText()
      The body decoded as UTF-8.
      Returns:
      the body text
    • toString

      public String toString()
      The status and media type only; the body may hold secrets.
      Overrides:
      toString in class Object
      Returns:
      a description safe to log