Hammock is yet another HTTP client for Scala. It tries to be typeful, purely functional, and work along other technologies that you're already using such as akka-http, circe, or cats.
Add the following to your build.sbt
.
// For Scala 2.10, 2.11, or 2.12
libraryDependencies += "com.pepegar" %% "hammock-core" % "0.8.4"
// For ScalaJS
libraryDependencies += "com.pepegar" %%% "hammock-core" % "0.8.4"
- It's easy to use, has a high level API
- It's typeful, tries to represent effects at type level.
- It does not force a specific target context. You can run your computations in any type
F[_]
that has an instance of cats-effect'sSync[F]
. - It has good documentation.
- It's modular
Module name | Description | Version |
---|---|---|
hammock-core |
the core functionality of hammock, using Apache HTTP commons for HTTP in JVM and XHR in JS | 0.8.4 |
hammock-circe |
encode and decode HTTP entities with Circe | 0.8.4 |
hammock-akka-http |
run your HTTP requests with akka-http | 0.8.4 |
hammock-asynchttpclient |
run your HTTP requests with AsyncHttpClient | 0.8.4 |
import cats.effect.IO
import io.circe.generic.auto._
import hammock._
import hammock.marshalling._
import hammock.jvm.Interpreter
import hammock.circe.implicits._
object HttpClient {
implicit val interpreter = Interpreter[IO]
val response = Hammock
.request(Method.GET, uri"https://api.fidesmo.com/apps", Map()) // In the `request` method, you describe your HTTP request
.as[List[String]]
.exec[IO]
}
People are expected to follow the Typelevel Code of Conduct when discussing Hammock on the Github page, Gitter channel, or other venues.