|
uncarved-helpers
|
|
com/uncarved/helpers/http/Client.scala]
abstract
class
Client
extends AnyRef| Value Summary | |
var
|
cache
: ResponseCache
Cache used by the conditional get mechanism
|
protected abstract val
|
client
: org.apache.http.impl.client.DefaultHttpClient
derived classes must define how they create and configure the client
|
val
|
connectionTimeout
: Int
override this to set the connection timeout
|
val
|
soTimeout
: Int
override this to set the socket timeout
|
val
|
userAgent
: java.lang.String
override this to set the User-Agent header on outgoing requests.
|
| Method Summary | |
protected def
|
entityString
(entity : scala.Option[org.apache.http.HttpEntity]) : java.lang.String
Translate an entity option into a string. Uses UTF-8 as a
default encoding if the entity doesn't set a charset in its
content-type header
|
abstract def
|
fetch
[T](req : Request)(thunk : (Response) => T) : T
Execute a request and run some code with the results.
|
abstract def
|
fetchOk
[T](req : Request)(thunk : (Response) => T) : T
Execute a request and run some code with the results if the response
code is "OK" (200 to 204).
|
def
|
shutdown
: Unit
Shut the client connection manager down, freeing all connection resources
|
| Methods inherited from AnyRef | |
| getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
| Methods inherited from Any | |
| ==, !=, isInstanceOf, asInstanceOf |
| Value Details |
val
userAgent : java.lang.String
val
connectionTimeout : Int
val
soTimeout : Int
var
cache : ResponseCache
protected abstract
val
client : org.apache.http.impl.client.DefaultHttpClient
| Method Details |
req - The http request (in the form of a Request)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 entityreq - The http request (in the form of a Request)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 entityprotected
def
entityString(entity : scala.Option[org.apache.http.HttpEntity]) : java.lang.String
def
shutdown : Unit
|
uncarved-helpers
|
|