类 UnknownContentTypeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.taketoday.core.NestedRuntimeException
cn.taketoday.web.client.RestClientException
cn.taketoday.web.client.UnknownContentTypeException
所有已实现的接口:
Serializable

public class UnknownContentTypeException extends RestClientException
Raised when no suitable HttpMessageConverter could be found to extract the response.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • targetType

      private final Type targetType
    • contentType

      private final MediaType contentType
    • statusCode

      private final HttpStatusCode statusCode
    • statusText

      private final String statusText
    • responseBody

      private final byte[] responseBody
    • responseHeaders

      private final HttpHeaders responseHeaders
  • 构造器详细资料

    • UnknownContentTypeException

      public UnknownContentTypeException(Type targetType, MediaType contentType, int statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody)
      Construct a new instance of with the given response data.
      参数:
      targetType - the expected target type
      contentType - the content type of the response
      statusCode - the raw status code value
      statusText - the status text
      responseHeaders - the response headers (may be null)
      responseBody - the response body content (may be null)
    • UnknownContentTypeException

      public UnknownContentTypeException(Type targetType, MediaType contentType, HttpStatusCode statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody)
      Construct a new instance of with the given response data.
      参数:
      targetType - the expected target type
      contentType - the content type of the response
      statusCode - the raw status code value
      statusText - the status text
      responseHeaders - the response headers (may be null)
      responseBody - the response body content (may be null)
  • 方法详细资料

    • getTargetType

      public Type getTargetType()
      Return the target type expected for the response.
    • getContentType

      public MediaType getContentType()
      Return the content type of the response, or "application/octet-stream".
    • getStatusCode

      public HttpStatusCode getStatusCode()
      Return the HTTP status code value.
    • getRawStatusCode

      public int getRawStatusCode()
      Return the raw HTTP status code value.
    • getStatusText

      public String getStatusText()
      Return the HTTP status text.
    • getResponseHeaders

      @Nullable public HttpHeaders getResponseHeaders()
      Return the HTTP response headers.
    • getResponseBody

      public byte[] getResponseBody()
      Return the response body as a byte array.
    • getResponseBodyAsString

      public String getResponseBodyAsString()
      Return the response body converted to String using the charset from the response "Content-Type" or "UTF-8" otherwise.