Package

com.nrinaudo

fetch

Permalink

package fetch

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. fetch
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait ByteRange extends AnyRef

    Permalink
  2. case class Conneg[T](value: T, q: Float = 1) extends Product with Serializable

    Permalink

    Represents an acceptable value for content negotiation headers (Accept*).

    Represents an acceptable value for content negotiation headers (Accept*).

    value

    value of the header (see the companion object for header formats).

    q

    weight of the value, as a float between 0 and 1 inclusive. Bigger weights tell remote servers that the corresponding value is more desirable than values associated with lower weights.

  3. trait ConnegFormat[T] extends HttpGrammar with ValueFormat[Seq[Conneg[T]]]

    Permalink

    Used to parse / serialize content negotiation header values.

    Used to parse / serialize content negotiation header values.

    In order to implement a format for a specific type, application developers only need to provide a Parser instance for that type by implementing the entry method.

  4. sealed trait ETag extends AnyRef

    Permalink

    Represents HTTP entity tags.

  5. trait Encoding extends AnyRef

    Permalink

    Handles HTTP content encoding.

  6. final case class FullRange(from: Int, to: Int) extends ByteRange with Product with Serializable

    Permalink
  7. class Headers extends Parameters[Headers]

    Permalink
  8. trait HttpGrammar extends RegexParsers

    Permalink
  9. sealed trait Language extends AnyRef

    Permalink

    Represents an entity's language.

    Represents an entity's language.

    These can be used for content negotiation or to describe the language in which a response is written.

    A language can either be global or country-specific.

  10. sealed trait MediaType extends AnyRef

    Permalink
  11. class MediaTypeParameters extends Parameters[MediaTypeParameters]

    Permalink
  12. sealed trait Method extends AnyRef

    Permalink
  13. trait Parameters[Self <: Parameters[Self]] extends AnyRef

    Permalink

    Stores a list of name / value pairs.

    Stores a list of name / value pairs.

    Values are stored in their serialized forms as String, but can be manipulated as more specific types provided corresponding instances of ValueReader and ValueWriter are in scope. Default implementations of these can be found in ValueFormat.

  14. final case class PrefixRange(from: Int) extends ByteRange with Product with Serializable

    Permalink
  15. sealed trait Protocol extends AnyRef

    Permalink

    Represents a valid URL protocol.

    Represents a valid URL protocol.

    Supported protocols are declared in the companion object.

    Protocol instances can be used to easily create urls:

    // Verbose:
    Protocol.Http.host("github.com")
    
    // Syntactic sugar:
    Protocol.Http :/ "github.com"
  16. class QueryString extends AnyRef

    Permalink

    Represents an Url's query string.

  17. trait Request[A] extends AnyRef

    Permalink

    Represents an HTTP request.

    Represents an HTTP request.

    Instances are created through the companion object. Once an instance is obtained, the request can be configured through "raw" modification methods (

    method

    ,

    headers

    ...) as well as specialised helpers such as

    GET

    ,

    acceptGzip

    or

    /

    .

    / }}}

    acceptGzip }}}

    GET }}}

    headers }}} as

    GET

    ,

    acceptGzip

    or

    /

    .

    / }}}

    acceptGzip }}}

    GET }}}

    method }}} as

    GET

    ,

    acceptGzip

    or

    /

    .

    / }}}

    acceptGzip }}}

    GET }}}

  18. trait RequestEntity extends RequestEntityLike[RequestEntity]

    Permalink
  19. trait RequestEntityLike[+Self <: RequestEntityLike[Self]] extends AnyRef

    Permalink
  20. case class Response[A](status: Status, headers: Headers, body: A) extends Product with Serializable

    Permalink

    Represents an HTTP response.

  21. class ResponseEntity extends AnyRef

    Permalink

    Represents a raw response entity.

  22. case class Status(code: Int) extends Product with Serializable

    Permalink

    Represents an HTTP status code, as defined in RFC 2616.

    Represents an HTTP status code, as defined in RFC 2616.

    This class and its companion objects provide various extraction helpers to ease pattern matching. For example:

    val res: Response[ResponseEntity] = ???
    
    res.status match {
      case Status.Success(_) => println("Success")
      case _                 => println("Not success")
    }

    It's also possible to pattern match directly on instances of Response, which can be useful when mapping on requests:

    val res: Request[Response[ResponseEntity]] = ???
    
    res map {
      // Match on the 2xx group
      case res @ Status.Success(_)       => println("Success: " + res.body.as[String])
      // Match on HTTP 500
      case Status.InternalServerError(_) => println("Internal server error")
      // Match on everything else
      case _                             => println("Something else entirely")
    }

    See the companion object for known status codes.

  23. final case class SuffixRange(to: Int) extends ByteRange with Product with Serializable

    Permalink
  24. trait TextRequestEntity extends RequestEntity with RequestEntityLike[TextRequestEntity]

    Permalink
  25. case class Url(protocol: Protocol, host: String, port: Int, path: List[String] = List(), query: QueryString = QueryString(), fragment: Option[String] = None) extends Product with Serializable

    Permalink
  26. class UrlEncoder extends AnyRef

    Permalink
  27. trait ValueFormat[T] extends ValueReader[T] with ValueWriter[T]

    Permalink

    Compounds a ValueReader and ValueWriter.

  28. trait ValueReader[T] extends AnyRef

    Permalink

    Used to read parameter values from an instance of Parameters.

    Used to read parameter values from an instance of Parameters.

    Annotations
    @implicitNotFound( ... )
  29. trait ValueWriter[T] extends AnyRef

    Permalink

    Used to write parameter values to an instance of Parameters.

    Used to write parameter values to an instance of Parameters.

    Annotations
    @implicitNotFound( ... )

Value Members

  1. object ByteRange

    Permalink
  2. object Conneg extends Serializable

    Permalink

    Collection of implicit header formats for known content negotiation headers.

  3. val DefaultCharset: Charset

    Permalink

    Charset used for request or response entities when none is specified.

  4. object ETag

    Permalink
  5. object Encoding

    Permalink
  6. object Headers

    Permalink
  7. object HttpGrammar

    Permalink
  8. implicit val IntEntityParser: EntityParser[Int]

    Permalink
  9. object Language

    Permalink

    Tools for creating instances of Language.

  10. object MediaType

    Permalink

    Defines MediaType implementations as well as known types.

  11. object MediaTypeParameters

    Permalink
  12. object Method

    Permalink
  13. object Protocol

    Permalink

    Declares known protocols and provides convenience methods.

  14. object QueryString

    Permalink
  15. object Request

    Permalink
  16. object RequestEntity

    Permalink
  17. object Response extends Serializable

    Permalink
  18. object ResponseEntity

    Permalink
  19. object Status extends Serializable

    Permalink

    Defines known HTTP status codes, as well as pattern match helpers.

  20. implicit val TextEntityParser: EntityParser[String]

    Permalink
  21. object Url extends Serializable

    Permalink
  22. object ValueFormat

    Permalink
  23. object ValueReader

    Permalink
  24. object ValueWriter

    Permalink
  25. implicit def charsetToConneg(charset: Charset): Conneg[Charset]

    Permalink
  26. implicit def encodingToConneg(encoding: Encoding): Conneg[Encoding]

    Permalink
  27. implicit def fileToEntity(file: File): RequestEntity

    Permalink
  28. implicit def localeToConneg(locale: Locale): Conneg[Locale]

    Permalink
  29. implicit def mediaTypeToConneg(mediaType: MediaType): Conneg[MediaType]

    Permalink
  30. package net

    Permalink
  31. implicit def readerToEntity(reader: Reader): RequestEntity

    Permalink
  32. implicit def streamToEntity(in: InputStream): RequestEntity

    Permalink
  33. implicit def stringToEntity(str: String): RequestEntity

    Permalink
  34. implicit def urlToRequest(url: Url)(implicit engine: HttpEngine): Request[Response[ResponseEntity]]

    Permalink
  35. def writeBytes(in: InputStream, out: OutputStream): Unit

    Permalink

    Writes the content of the specified input stream to the specified output stream.

    Writes the content of the specified input stream to the specified output stream. Note that this method does not wrap its arguments in buffered streams, nor will it close either stream.

  36. def writeChars(in: Reader, out: Writer): Unit

    Permalink

    Writes the content of the specified reader to the specified writer.

    Writes the content of the specified reader to the specified writer. Note that this method does not wrap its arguments in buffered implementations, nor will it close either stream.

Inherited from AnyRef

Inherited from Any

Ungrouped