net.liftweb.http.testing.HttpResponse

class HttpResponse

class HttpResponse(baseUrl : String, code : Int, msg : String, headers : Map[String, List[String]], body : Box[Array[Byte]], theHttpClient : HttpClient)

 extends BaseResponse with ToResponse with TestResponse


The response to an HTTP request, as long as the server responds with *SOMETHING*


Source: TestFramework.scala(696)

 Constructors

def this(baseUrl : String, code : Int, msg : String, headers : Map[String, List[String]], body : Box[Array[Byte]], theHttpClient : HttpClient)

 Fields

bodyAsString.. lazy val bodyAsString Box[String] BaseResponse
contentType.. lazy val contentType String BaseResponse
xml.. override lazy val xml
The XML for the body
Box[Elem] BaseResponse

 Methods

!.. 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 BaseResponse
!.. 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 BaseResponse
!=.. final def !=(arg0 : Any) Boolean Any
!=.. final def !=(arg0 : Object) Boolean AnyRef
!@.. 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 BaseResponse
==.. final def ==(arg0 : Object) Boolean AnyRef
==.. final def ==(arg0 : Any) Boolean Any
asInstanceOf.. final def asInstanceOf[T0] T0 Any
clone.. protected def clone Object AnyRef
delete.. def delete(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP DELETE [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
delete.. def delete(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP DELETE with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
filter.. 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 BaseResponse
finalize.. protected def finalize Unit AnyRef
foreach.. def foreach(f : (FuncType) => Unit)
the Response has a foreach method for chaining in a for comprehension
Unit BaseResponse
get.. def get(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP GET [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
get.. def get(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP GET with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
jsonToRequestEntity.. implicit def jsonToRequestEntity(body : JValue) RequestEntity BaseGetPoster
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
post.. def post[RT](url : String, httpClient : HttpClient, headers : List[(String, String)], body : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP POST with an XML body [details]
param
headers - - any additional headers to include with the request
body - - the xml to post
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
post.. def post[RT](url : String, xml : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP POST with a newly minted httpClient [details]
param
xml - the XML to POST to the server
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
body - the bytes to POST to the server
contentType - the content type of the message
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, httpClient : HttpClient, headers : List[(String, String)], body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a pile of bytes in the body [details]
param
contentType - - the content type of the pile of bytes
headers - - any additional headers to include with the request
body - - the pile of bytes to POST to the target server
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
post.. def post(url : String, params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
params - the parameters to pass
url - the URL to make the request on
ResponseType GetPosterHelper
post.. def post(url : String, httpClient : HttpClient, headers : List[(String, String)], faux_params : (String, Any)*)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST [details]
param
headers - - any additional headers to include with the request
faux_params - - the request parameters to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put(url : String, httpClient : HttpClient, headers : List[(String, String)], body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP PUT with a pile of bytes in the body [details]
param
contentType - - the content type of the pile of bytes
headers - - any additional headers to include with the request
body - - the pile of bytes to POST to the target server
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put[RT](url : String, xml : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP PUT with a newly minted httpClient [details]
param
xml - the XML to PUT to the server
url - the URL to make the request on
ResponseType GetPosterHelper
put.. def put(url : String, httpClient : HttpClient, headers : List[(String, String)])(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP PUT [details]
param
headers - - any additional headers to include with the request
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put[RT](url : String, httpClient : HttpClient, headers : List[(String, String)], body : RT)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType, implicit bodyToRequestEntity : (RT) => RequestEntity)
Perform an HTTP PUT with an XML body [details]
param
headers - - any additional headers to include with the request
body - - the xml to post
url - - the URL to append to the baseUrl
ResponseType BaseGetPoster
put.. def put(url : String, body : Array[Byte], contentType : String)(implicit capture : (String, HttpClient, HttpMethodBase) => ResponseType)
Perform an HTTP POST with a newly minted httpClient [details]
param
body - the bytes to POST to the server
contentType - the content type of the message
url - the URL to make the request on
ResponseType GetPosterHelper
responseCapture.. implicit def responseCapture(fullUrl : String, httpClient : HttpClient, getter : HttpMethodBase) TestResponse ToResponse
slurpApacheHeaders.. protected def slurpApacheHeaders(in : Array[Header]) Map[String, List[String]] BaseGetPoster
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toString.. def toString String AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
xmlToRequestEntity.. implicit def xmlToRequestEntity(body : NodeSeq) RequestEntity BaseGetPoster
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.