Object

hammock

Hammock

Related Doc: package hammock

Permalink

object Hammock

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

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def deleteWithOpts(uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates a DELETE request to the given uri and opts.

    Creates a DELETE request to the given uri and opts.

    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    Hammock.deleteWithOpts(uri"http://httpbin.org/get", opts)
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def getWithOpts(uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates a GET request to the given uri and opts.

    Creates a GET request to the given uri and opts.

    scala> import hammock._, hammock.jvm.Interpreter, hammock.hi._, hammock.hi._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    scala> val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    opts: hammock.hi.Opts = Opts(Some(BasicAuth(user,pass)),Map(X-Test -> works!),Some(List(Cookie(key,value,None,None,None,None,None,None,None,None))))
    
    scala> Hammock.getWithOpts(uri"http://httpbin.org/get", opts)
    res1: Free[HttpF, hammock.HttpResponse] = Free(...)
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def headWithOpts(uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates a HEAD request to the given uri and opts.

    Creates a HEAD request to the given uri and opts.

    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    Hammock.headWithOpts(uri"http://httpbin.org/get", opts)
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def optionsWithOpts(uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates an OPTIONS request to the given uri and opts.

    Creates an OPTIONS request to the given uri and opts.

    scala> import hammock._, hammock.jvm.Interpreter, hammock.hi._, hammock.hi._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    scala> val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    opts: hammock.hi.Opts = Opts(Some(BasicAuth(user,pass)),Map(X-Test -> works!),Some(List(Cookie(key,value,None,None,None,None,None,None,None,None))))
    
    scala> Hammock.optionsWithOpts(uri"http://httpbin.org/get", opts)
    res1: Free[HttpF, hammock.HttpResponse] = Free(...)
  19. def patchWithOpts[A](uri: Uri, opts: Opts, body: Option[A] = None)(implicit arg0: Codec[A]): Free[HttpF, HttpResponse]

    Permalink

    Creates a PATCH request to the given uri and opts.

    Creates a PATCH request to the given uri and opts. It also has an optional body parameter that can be used.

    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    implicit val stringCodec = new Codec[String] {
       def encode(s: String) = s
       def decode(s: String) = Right(s)
    }
    
    Hammock.patchWithOpts(uri"http://httpbin.org/patch", opts, Some("""{"body": true}"""))
  20. def postWithOpts[A](uri: Uri, opts: Opts, body: Option[A] = None)(implicit arg0: Encoder[A]): Free[HttpF, HttpResponse]

    Permalink

    Creates a POST request to the given uri and opts.

    Creates a POST request to the given uri and opts. It also has an optional body parameter that can be used.

    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    implicit val stringEncoder = new Encoder[String] {
       def encode(s: String) = s
    }
    
    Hammock.postWithOpts(uri"http://httpbin.org/get", opts, Some("""{"body": true}"""))
  21. def putWithOpts[A](uri: Uri, opts: Opts, body: Option[A] = None)(implicit arg0: Encoder[A]): Free[HttpF, HttpResponse]

    Permalink

    Creates a PUT request to the given uri and opts.

    Creates a PUT request to the given uri and opts. It also has an optional body parameter that can be used.

    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    implicit val stringEncoder = new Encoder[String] {
       def encode(s: String) = s
    }
    
    Hammock.postWithOpts(uri"http://httpbin.org/get", opts, Some("""{"body": true}"""))
  22. def request[A](method: Method, uri: Uri, headers: Map[String, String], body: Option[A])(implicit arg0: Encoder[A]): Free[HttpF, HttpResponse]

    Permalink

    similar to request, but you can pass it a body when it exists an instance for the Encoder typeclass for the given type A

  23. def request(method: Method, uri: Uri, headers: Map[String, String]): Free[HttpF, HttpResponse]

    Permalink

    Creates an HttpF and from the Method, Uri, and String] headers.

    Creates an HttpF and from the Method, Uri, and String] headers. It can be later executed via an interpreter.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. def traceWithOpts(uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates a TRACE request to the given uri and opts.

    Creates a TRACE request to the given uri and opts.

    val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    
    Hammock.traceWithOpts(uri"http://httpbin.org/get", opts)
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def withOpts[A](method: Method, uri: Uri, opts: Opts, body: Option[A])(implicit arg0: Encoder[A]): Free[HttpF, HttpResponse]

    Permalink

    Variant of withOpts methods that also takes an optional body of a request.

    Variant of withOpts methods that also takes an optional body of a request. There should be a Encoder instance for the body type for this to work.

    See also

    Hammock.withOpts

  31. def withOpts(method: Method, uri: Uri, opts: Opts): Free[HttpF, HttpResponse]

    Permalink

    Creates a request value given a method, uri, and opts, and suspends it into a cats.free.Free.

    Creates a request value given a method, uri, and opts, and suspends it into a cats.free.Free.

    Usage:

    scala> import hammock._, hammock.jvm.Interpreter, hammock.hi._, hammock.hi._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.Interpreter
    import hammock.hi._
    import cats._
    import cats.implicits._
    import scala.util.Try
    
    scala> val opts = (header("X-Test" -> "works!") >>> auth(Auth.BasicAuth("user", "pass")) >>> cookie(Cookie("key", "value")))(Opts.empty)
    opts: hammock.hi.Opts = Opts(Some(BasicAuth(user,pass)),Map(X-Test -> works!),Some(List(Cookie(key,value,None,None,None,None,None,None,None,None))))
    
    scala> val response = Hammock.withOpts(Method.GET, uri"http://httpbin.org/get", opts)
    response: Free[HttpF, hammock.HttpResponse] = Free(...)

Inherited from AnyRef

Inherited from Any

Ungrouped