net.liftweb.http.testing.Response

trait Response

trait Response

 extends Object


A response returned from an HTTP request. Responses can be chained and tested in a for comprehension:

 implicit val

 for  {
    login <- post("/api/login", "user" -> "me", "pwd" -> "me") !@ "Failed to log in"
    info <- login.get("/api/info") if info.bodyAsString must_== "My Info"
    moreInfo <- info.post("/api/moreInfo", <info>Some Info</info>)
 } moreInfoheaders("X-MyInfo") must_== List("hello", "goodbye")
 


Source: TestFramework.scala(642)

Direct Known Subclasses

TestResponse, BaseResponse,

 Fields

headers.. abstract def headers
The response headers
Map[String, List[String]]
xml.. abstract def xml
The XML for the body
Box[Elem]

 Methods

!.. abstract def !(msg : => String)(implicit errorFunc : ReportFailure)
Test that the server gave a response [details]
If the server failed to respond, call the errorFunc with the msg
param
errorFunc - the error reporting thing.
msg - the String to report as an error
SelfType
!.. abstract def !(code : Int, msg : => String)(implicit errorFunc : ReportFailure)
Test that the server gave a particular response code [details]
If the response is not a 200, call the errorFunc with the msg
param
errorFunc - the error reporting thing.
msg - the String to report as an error
SelfType
!=.. final def !=(arg0 : Object) Boolean AnyRef
!=.. final def !=(arg0 : Any) Boolean Any
!@.. abstract def !@(msg : => String)(implicit errorFunc : ReportFailure)
Test the response as a 200 [details]
If the response is not a 200, call the errorFunc with the msg
param
errorFunc - the error reporting thing.
msg - the String to report as an error
SelfType
==.. final def ==(arg0 : Any) Boolean Any
==.. final def ==(arg0 : Object) Boolean AnyRef
asInstanceOf.. final def asInstanceOf[T0] T0 Any
clone.. protected def clone Object AnyRef
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
filter.. abstract def filter(f : (FuncType) => Unit)
the Response has a filter method for chaining in a for comprehension [details]
Note that the filter method does *NOT* have to return a Boolean, any expression (e.g., an assertion)
FuncType
finalize.. protected def finalize Unit AnyRef
foreach.. abstract def foreach(f : (FuncType) => Unit)
the Response has a foreach method for chaining in a for comprehension
Unit
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.