HttpResponse

uk.gov.hmrc.http.HttpResponse
See theHttpResponse companion object
trait HttpResponse

The ws.Response class is very hard to dummy up as it wraps a concrete instance of the ning http Response. This trait exposes just the bits of the response that we need in methods that we are passing the response to for processing, making it much easier to provide dummy data in our specs.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def body: String
def headers: Map[String, Seq[String]]
def status: Int

Concrete methods

def bodyAsSource: Source[ByteString, _]
def header(key: String): Option[String]
def json: JsValue

Converts the body to a JsValue, if possible. Consider using HttpReads instead for converting the body to Json and handling failures.

Converts the body to a JsValue, if possible. Consider using HttpReads instead for converting the body to Json and handling failures.

Attributes

Throws
RuntimeException

if the body cannot be converted to JsValue.

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any