com.uncarved.helpers.http

trait RichClient

[source: com/uncarved/helpers/http/RichClient.scala]

trait RichClient
extends Client
Trait which uses the interface above to provide a rich and convenient http client interface.
Direct Known Subclasses:
BasicClient

Values and Variables inherited from Client
client (abstract), userAgent, connectionTimeout, soTimeout, cache
Method Summary
def fetchOk [T](reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)])(thunk : (Response) => T) : T
Execute a request and run some code with the results if the response code is "OK" (200 to 204).
def get (path : java.lang.String) : java.lang.String
Do an http GET and return the results as a string
def get (path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http GET and return the results as a string
def getContent (path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.io.InputStream
Do an http GET request and return the response entity contents
def getContent (reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.io.InputStream
Do an http request and return the response entity contents
def getContent (req : Request) : java.io.InputStream
Do an http request and return the response entity contents
def getSource (path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.io.Source
Do an http GET request and return a scala IO source
def getSource (reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.io.Source
Do an http request and return a scala IO source
def getSource (req : Request) : scala.io.Source
Do an http request and return a scala IO source
def getString (req : Request) : java.lang.String
Do an http requst and return the results as a string
def getString (reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http requst and return the results as a string
def getXML (req : Request) : scala.xml.Elem
Do an http request and parse the results as XML and return the XML sequence
def getXML (path : java.lang.String) : scala.xml.Elem
Do an http GET request and parse the results as XML and return the XML sequence
def getXML (path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.xml.Elem
Do an http GET request and parse the results as XML and return the XML sequence
def getXML (reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.xml.Elem
Do an http request and parse the results as XML and return the XML sequence
def post (path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http POST and return the results as a string
Methods inherited from Client
fetch (abstract), fetchOk (abstract), entityString, shutdown
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def fetchOk[T](reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)])(thunk : (Response) => T) : T
Execute a request and run some code with the results if the response code is "OK" (200 to 204).
Parameters
reqType - The http request type
path - The url
thunk - A code snippet that takes a response code, the response and an entity option that will be None if the response didn't result in an entity
params - The request parameters

def getString(req : Request) : java.lang.String
Do an http requst and return the results as a string
Parameters
req - The request

def getString(reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http requst and return the results as a string
Parameters
reqType - The http request type
path - The url
params - The request parameters

def get(path : java.lang.String) : java.lang.String
Do an http GET and return the results as a string
Parameters
path - The url

def get(path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http GET and return the results as a string
Parameters
path - The url
params - The request parameters

def post(path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.lang.String
Do an http POST and return the results as a string
Parameters
path - The url
params - The request parameters

def getContent(req : Request) : java.io.InputStream
Do an http request and return the response entity contents
Parameters
req - The request helper for the reqest

def getContent(reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.io.InputStream
Do an http request and return the response entity contents
Parameters
reqType - The http request type
path - The url
params - The request parameters

def getContent(path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : java.io.InputStream
Do an http GET request and return the response entity contents
Parameters
path - The url
params - The request parameters

def getSource(req : Request) : scala.io.Source
Do an http request and return a scala IO source
Parameters
req - The http request
params - The request parameters

def getSource(reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.io.Source
Do an http request and return a scala IO source
Parameters
reqType - The http request type
path - The url
params - The request parameters

def getSource(path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.io.Source
Do an http GET request and return a scala IO source
Parameters
path - The url
params - The request parameters

def getXML(req : Request) : scala.xml.Elem
Do an http request and parse the results as XML and return the XML sequence
Parameters
req - The request helper for the request

def getXML(reqType : scala.Enumeration.Value, path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.xml.Elem
Do an http request and parse the results as XML and return the XML sequence
Parameters
reqType - The http request type
path - The url
params - The request parameters

def getXML(path : java.lang.String, params : scala.Seq[(java.lang.String, java.lang.String)]) : scala.xml.Elem
Do an http GET request and parse the results as XML and return the XML sequence
Parameters
path - The url
params - The request parameters

def getXML(path : java.lang.String) : scala.xml.Elem
Do an http GET request and parse the results as XML and return the XML sequence
Parameters
path - The url