You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Installation
Add the following to your build.sbt.
// For Scala 2.10, 2.11, or 2.12
libraryDependencies ++=Seq(
"com.pepegar"%%"hammock-core"%"0.10.0",
// Hammock for standard Scala doesn't ship with a standard implementation"com.pepegar"%%"hammock-apache-http"%"0.10.0"
)
// For ScalaJS
libraryDependencies +="com.pepegar"%%%"hammock-core"%"0.10.0"
Rationale
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's Sync[F].
importcats.effect.IOimporthammock._importhammock.marshalling._importhammock.apache.ApacheInterpreterimporthammock.circe.implicits._objectHttpClient {
// Using the Apache HTTP commons interpreterimplicitvalinterpreter=ApacheInterpreter.instance[IO]
valresponse=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]
}
Code of conduct
People are expected to follow the Typelevel Code of Conduct when discussing Hammock on the Github page, Gitter channel, or other venues.