hammock

Hammock

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
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Create an DELETE request to the given uri and Opts opts.

    Create an DELETE request to the given uri and Opts opts.

    scala> val opts = (header("X-Test" -> "works!") &> auth(Auth.BasicAuth("user", "pass")) &> cookie(Cookie("key", "value")))(Opts.default)
    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.deleteWithOpts(Uri.unsafeParse("http://httpbin.org/get"), opts)
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  9. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  13. def getWithOpts(uri: Uri, opts: Opts): HttpRequestIO[HttpResponse]

    Create an GET request to the given uri and Opts opts.

    Create an GET request to the given uri and Opts opts.

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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.unsafeParse("http://httpbin.org/get"), opts)
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. def headWithOpts(uri: Uri, opts: Opts): HttpRequestIO[HttpResponse]

    Create an HEAD request to the given uri and Opts opts.

    Create an HEAD request to the given uri and Opts opts.

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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.headWithOpts(Uri.unsafeParse("http://httpbin.org/get"), opts)
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  16. final def isInstanceOf[T0]: Boolean

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

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def optionsWithOpts(uri: Uri, opts: Opts): HttpRequestIO[HttpResponse]

    Create an OPTIONS request to the given uri and Opts opts.

    Create an OPTIONS request to the given uri and Opts opts.

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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.unsafeParse("http://httpbin.org/get"), opts)
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  21. def postWithOpts[A](uri: Uri, opts: Opts, body: Option[A] = None)(implicit arg0: Codec[A]): HttpRequestIO[HttpResponse]

    Create an POST request to the given uri and opts.

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

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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> implicit val stringCodec = new Codec[String] {
         |   def encode(s: String) = s
         |   def decode(s: String) = Right(s)
         | }
    stringCodec: hammock.Codec[String]{def decode(s: String): scala.util.Right[Nothing,String]} = $anon$1@1533f96a
    
    scala> Hammock.postWithOpts(Uri.unsafeParse("http://httpbin.org/get"), opts, Some("""{"body": true}"""))
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  22. def putWithOpts[A](uri: Uri, opts: Opts, body: Option[A] = None)(implicit arg0: Codec[A]): HttpRequestIO[HttpResponse]

    Create an PUT request to the given uri and opts.

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

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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> implicit val stringCodec = new Codec[String] {
         |   def encode(s: String) = s
         |   def decode(s: String) = Right(s)
         | }
    stringCodec: hammock.Codec[String]{def decode(s: String): scala.util.Right[Nothing,String]} = $anon$1@1533f96a
    
    scala> Hammock.putWithOpts(Uri.unsafeParse("http://httpbin.org/get"), opts, Some("""{"body": true}"""))
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  23. def request[A](method: Method, uri: Uri, headers: Map[String, String], body: Option[A])(implicit arg0: Codec[A]): HttpRequestIO[HttpResponse]

    Create an hammock.HttpRequestIO as well, but you can pass it a body when it exists an instance for the Codec typeclass for the given type A

  24. def request(method: Method, uri: Uri, headers: Map[String, String]): HttpRequestIO[HttpResponse]

    Create an hammock.HttpRequestIO[HttpResponse] from the Method, Uri, and String] headers.

    Create an hammock.HttpRequestIO[HttpResponse] from the Method, Uri, and String] headers. It can be later executed via an interpreter.

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

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. def traceWithOpts(uri: Uri, opts: Opts): HttpRequestIO[HttpResponse]

    Create an TRACE request to the given uri and Opts opts.

    Create an TRACE request to the given uri and Opts opts.

    scala> val opts = (header("X-Test" -> "works!") &> auth(Auth.BasicAuth("user", "pass")) &> cookie(Cookie("key", "value")))(Opts.default)
    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.traceWithOpts(Uri.unsafeParse("http://httpbin.org/get"), opts)
    res1: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)
  28. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def withOpts[A](method: Method, uri: Uri, opts: Opts, body: Option[A])(implicit arg0: Codec[A]): HttpRequestIO[HttpResponse]

    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 Codec instance for the body type for this to work.

    See also

    Hammock.withOpts

  32. def withOpts(method: Method, uri: Uri, opts: Opts): HttpRequestIO[HttpResponse]

    Creates a HttpRequestIO[HttpResponse] value given a Method method, uri, and opts.

    Creates a HttpRequestIO[HttpResponse] value given a Method method, uri, and opts.

    Usage:

    scala> import hammock._, hammock.jvm.free.Interpreter, hammock.hi._, hammock.hi.dsl._, cats._, cats.implicits._, scala.util.Try
    import hammock._
    import hammock.jvm.free.Interpreter
    import hammock.hi._
    import hammock.hi.dsl._
    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.default)
    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.unsafeParse("http://httpbin.org/get"), opts)
    response: hammock.free.algebra.HttpRequestIO[hammock.HttpResponse] = Free(...)

Inherited from AnyRef

Inherited from Any

Ungrouped