com.pagerduty

funhttpclient

package funhttpclient

Overview

An HTTP client with a functional interface.

fun-http-client is a small functional interface to the HTTP client in the Spray (http://spray.io/) library.

You should use fun-http-client if you want an HTTP client with clear and explicit error handling (instead of exceptions), request logging, and an easy interface for building computations around HTTP requests asynchronously.

See /example/JsonTest.scala in the top-level source directory for a worked example with JSON parsing.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. funhttpclient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class Http[E, A] extends HttpInstances with Product with Serializable

    A computation that involves remote requests over HTTP.

    A computation that involves remote requests over HTTP.

    Http computations are asynchronous, log HTTP requests that are made, and have explicit error handling (without exceptions).

    They have a simple functional interface consisting of:

    as well as additional functions for error handling by-value.

    Http computations can have one of two outcomes: an error of type E or a result of type A.

    Errors short-circuit computations and are threaded to the final result.

    Http computations should be converted to Scala futures via asFuture or asFutureWithLog for further computation.

    To those with functional programming experience, an Http is essentially a monad transformer consisting of an either, a writer, and a Scala Future.

  2. trait HttpDriver extends AnyRef

    HTTP drivers are responsible for actually executing the HTTP request and getting back a response.

    HTTP drivers are responsible for actually executing the HTTP request and getting back a response.

    The driver is used in HttpOps.request to make a request.

  3. trait HttpInstances extends AnyRef

    Scalaz instances.

    Scalaz instances.

    Here be dragons.

    These monad instances exist to make the implementation of this client easier, but they are not exposed by the interface and users of this library don't have to worry about them.

  4. trait HttpOps[E] extends HttpInstances

  5. case class LogEntry extends Product with Serializable

    Every HTTP request made is logged with the actual request, the time it was initiated, and it's duration.

  6. case class NetworkError(inner: Throwable) extends Product with Serializable

Value Members

  1. object HttpDriver

  2. object HttpOps extends HttpInstances

  3. object LogEntry extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped