Class Response.Body

java.lang.Object
com.squareup.okhttp.Response.Body
Enclosing class:
Response

public abstract static class Response.Body
extends Object
  • Constructor Details

    • Body

      public Body()
  • Method Details

    • contentType

      public String contentType()
    • contentLength

      public long contentLength()
    • byteStream

      public abstract InputStream byteStream() throws IOException
      Throws:
      IOException
    • bytes

      public byte[] bytes() throws IOException
      Throws:
      IOException
    • charStream

      public Reader charStream() throws IOException
      Returns the response bytes as a UTF-8 character stream. Do not call this method if the response content is not a UTF-8 character stream.
      Throws:
      IOException
    • string

      public String string() throws IOException
      Returns the response bytes as a UTF-8 string. Do not call this method if the response content is not a UTF-8 character stream.
      Throws:
      IOException