Class

scalaj.http

HttpResponse

Related Doc: package http

Permalink

case class HttpResponse[T](body: T, code: Int, headers: Map[String, IndexedSeq[String]]) extends Product with Serializable

Result of executing a scalaj.http.HttpRequest

T

the body response since it can be parsed directly to things other than String

body

the Http response body

code

the http response code from the status line

headers

the response headers

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpResponse
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpResponse(body: T, code: Int, headers: Map[String, IndexedSeq[String]])

    Permalink

    body

    the Http response body

    code

    the http response code from the status line

    headers

    the response headers

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val body: T

    Permalink

    the Http response body

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val code: Int

    Permalink

    the http response code from the status line

  8. def contentType: Option[String]

    Permalink

    Content-Type header value

  9. def cookies: IndexedSeq[HttpCookie]

    Permalink

    Get the parsed cookies from the "Set-Cookie" header *

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def header(key: String): Option[String]

    Permalink

    Get the response header value for a key

  14. def headerSeq(key: String): IndexedSeq[String]

    Permalink

    Get all the response header values for a repeated key

  15. val headers: Map[String, IndexedSeq[String]]

    Permalink

    the response headers

  16. def is2xx: Boolean

    Permalink

    is response code 2xx

  17. def is3xx: Boolean

    Permalink

    is response code 3xx

  18. def is4xx: Boolean

    Permalink

    is response code 4xx

  19. def is5xx: Boolean

    Permalink

    is response code 5xx

  20. def isClientError: Boolean

    Permalink

    same as is4xx

  21. def isCodeInRange(lower: Int, upper: Int): Boolean

    Permalink

    test if code is in between lower and upper inclusive

  22. def isError: Boolean

    Permalink

    same as (is4xx || is5xx)

  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isNotError: Boolean

    Permalink

    same as !isError

  25. def isRedirect: Boolean

    Permalink

    same as is3xx

  26. def isServerError: Boolean

    Permalink

    same as is5xx

  27. def isSuccess: Boolean

    Permalink

    same as is2xx

  28. def location: Option[String]

    Permalink

    Location header value sent for redirects.

    Location header value sent for redirects. By default, this library will not follow redirects.

  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def statusLine: String

    Permalink

    The full status line.

    The full status line. like "HTTP/1.1 200 OK" throws a RuntimeException if "Status" is not in headers

  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def throwError: HttpResponse[T]

    Permalink

    Throw a

    Throw a

    scalaj.http.HttpStatusException}} if {{{isError

    is true. Otherwise returns reference to self

    Useful if you don't want to handle 4xx or 5xx error codes from the server and just want bubble up an Exception instead. HttpException.body will just be body.toString.

    Allows for chaining like this:

    val result: String = Http(url).asString.throwError.body

    scalaj.http.HttpStatusException}} if {{{isError }}}

    Useful if you don't want to handle 4xx or 5xx error codes from the server and just want bubble up an Exception instead. HttpException.body will just be body.toString.

    Allows for chaining like this:

    val result: String = Http(url).asString.throwError.body
  35. def throwServerError: HttpResponse[T]

    Permalink

    Throw a

    Throw a

    scalaj.http.HttpStatusException}} if {{{isServerError

    is true. Otherwise returns reference to self

    Useful if you don't want to 5xx error codes from the server and just want bubble up an Exception instead. HttpException.body will just be body.toString.

    Allows for chaining like this:

    val result: String = Http(url).asString.throwServerError.body

    scalaj.http.HttpStatusException}} if {{{isServerError }}}

    Useful if you don't want to 5xx error codes from the server and just want bubble up an Exception instead. HttpException.body will just be body.toString.

    Allows for chaining like this:

    val result: String = Http(url).asString.throwServerError.body
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped