requests

package requests

Type members

Classlikes

Companion:
object
Companion:
class
sealed trait Cert
Companion:
object
object Cert
Companion:
class
trait Compress

Mechanisms for compressing the upload stream; supports Gzip and Deflate by default

Mechanisms for compressing the upload stream; supports Gzip and Deflate by default

Companion:
object
object Compress
Companion:
class
class InvalidCertException(val url: String, cause: Throwable) extends RequestsException
case class MultiItem(name: String, data: RequestBlob, filename: String)
case class MultiPart(items: MultiItem*) extends MultipartFormRequestBlob
case class Request(url: String, auth: RequestAuth, params: Iterable[(String, String)], headers: Iterable[(String, String)], readTimeout: Int, connectTimeout: Int, proxy: (String, Int), cert: Cert, sslContext: SSLContext, cookies: Map[String, HttpCookie], cookieValues: Map[String, String], maxRedirects: Int, verifySslCerts: Boolean, autoDecompress: Boolean, compress: Compress, keepAlive: Boolean, check: Boolean)

The equivalent of configuring a Requester.apply or Requester.stream call, but without invoking it. Useful if you want to further customize it and make the call later via the overloads of apply/stream that take a Request.

The equivalent of configuring a Requester.apply or Requester.stream call, but without invoking it. Useful if you want to further customize it and make the call later via the overloads of apply/stream that take a Request.

Different ways you can authorize a HTTP request; by default, HTTP Basic auth and Proxy auth are supported

Different ways you can authorize a HTTP request; by default, HTTP Basic auth and Proxy auth are supported

Companion:
object
Companion:
class

Represents the different things you can upload in the body of a HTTP request. By default allows form-encoded key-value pairs, arrays of bytes, strings, files, and inputstreams. These types can be passed directly to the data parameter of Requester.apply and will be wrapped automatically by the implicit constructors.

Represents the different things you can upload in the body of a HTTP request. By default allows form-encoded key-value pairs, arrays of bytes, strings, files, and inputstreams. These types can be passed directly to the data parameter of Requester.apply and will be wrapped automatically by the implicit constructors.

Companion:
object
Companion:
class
object Requester
Companion:
class
case class Requester(verb: String, sess: BaseSession)
Companion:
object
class RequestsException(val message: String, val cause: Option[Throwable]) extends Exception
case class Response(url: String, statusCode: Int, statusMessage: String, data: Bytes, headers: Map[String, Seq[String]], history: Option[Response]) extends ByteData with Readable

Represents a HTTP response

Represents a HTTP response

Value parameters:
data

the response body; may contain HTML, JSON, or binary or textual data

headers

the raw headers the server sent back with the response

history

the response of any redirects that were performed before arriving at the current response

statusCode

the status code of the response

statusMessage

the status message of the response

url

the URL that the original request was made to

class ResponseBlob(val bytes: Array[Byte])

Wraps the array of bytes returned in the body of a HTTP response

Wraps the array of bytes returned in the body of a HTTP response

case class Session(headers: Map[String, String], cookieValues: Map[String, String], cookies: Map[String, HttpCookie], auth: RequestAuth, proxy: (String, Int), cert: Cert, sslContext: SSLContext, persistCookies: Boolean, maxRedirects: Int, readTimeout: Int, connectTimeout: Int, verifySslCerts: Boolean, autoDecompress: Boolean, compress: Compress, chunkedUpload: Boolean, check: Boolean) extends BaseSession

A long-lived session; this can be used to automatically persist cookies from one request to the next, or to set default configuration that will be shared between requests. These configuration flags can all be over-ridden by the parameters on Requester.apply or Requester.stream

A long-lived session; this can be used to automatically persist cookies from one request to the next, or to set default configuration that will be shared between requests. These configuration flags can all be over-ridden by the parameters on Requester.apply or Requester.stream

Value parameters:
auth

HTTP authentication you want to use with this request; defaults to none

connectTimeout

How long to wait for a connection before timing out

cookies

Custom cookies to send up with this request

headers

Custom headers to use, in addition to the defaults

maxRedirects

How many redirects to automatically resolve; defaults to 5. You can also set it to 0 to prevent Requests from resolving redirects for you

proxy

Host and port of a proxy you want to use

readTimeout

How long to wait for data to be read before timing out

verifySslCerts

Set this to false to ignore problems with SSL certificates

case class StreamHeaders(url: String, statusCode: Int, statusMessage: String, headers: Map[String, Seq[String]], history: Option[Response])
class TimeoutException(val url: String, val readTimeout: Int, val connectTimeout: Int) extends RequestsException
class UnknownHostException(val url: String, val host: String) extends RequestsException
object Util

Value members

Concrete methods

def autoDecompress: Boolean
def cert: Cert
def check: Boolean
def chunkedUpload: Boolean
def cookies: Map[String, HttpCookie]
def maxRedirects: Int
def persistCookies: Boolean
def proxy: (String, Int)
def readTimeout: Int
def sslContext: SSLContext
def verifySslCerts: Boolean

Inherited methods

def send(method: String): Requester
Inherited from:
BaseSession

Concrete fields

val headers: Map[String, String]

Inherited fields

lazy val delete: Requester
Inherited from:
BaseSession
lazy val get: Requester
Inherited from:
BaseSession
lazy val head: Requester
Inherited from:
BaseSession
lazy val options: Requester
Inherited from:
BaseSession
lazy val patch: Requester
Inherited from:
BaseSession
lazy val post: Requester
Inherited from:
BaseSession
lazy val put: Requester
Inherited from:
BaseSession