All Projects → pepegar → Hammock

pepegar / Hammock

Licence: mit
Purely functional HTTP client

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Hammock

Sup
Composable, purely functional healthchecks in Scala.
Stars: ✭ 138 (-20.69%)
Mutual labels:  typelevel, cats, fp
Monix
Asynchronous, Reactive Programming for Scala and Scala.js.
Stars: ✭ 1,819 (+945.4%)
Mutual labels:  typelevel, cats, fp
Cats Infographic
typeclass diagram for cats
Stars: ✭ 403 (+131.61%)
Mutual labels:  typelevel, cats, fp
Shapeless
Generic programming for Scala
Stars: ✭ 3,207 (+1743.1%)
Mutual labels:  typelevel, fp
http4s-dom
http4s, in a browser near you
Stars: ✭ 13 (-92.53%)
Mutual labels:  cats, typelevel
Pfps Shopping Cart
🛒 The Shopping Cart application developed in the book "Practical FP in Scala: A hands-on approach"
Stars: ✭ 262 (+50.57%)
Mutual labels:  cats, fp
pfps-examples
🏮 Standalone examples shown in the book "Practical FP in Scala: A hands-on approach"
Stars: ✭ 167 (-4.02%)
Mutual labels:  cats, fp
Http4s
A minimal, idiomatic Scala interface for HTTP
Stars: ✭ 2,173 (+1148.85%)
Mutual labels:  typelevel, cats
Frameless
Expressive types for Spark.
Stars: ✭ 717 (+312.07%)
Mutual labels:  typelevel, fp
Doobie
Functional JDBC layer for Scala.
Stars: ✭ 1,910 (+997.7%)
Mutual labels:  typelevel, fp
Neutron
🌠 Purely functional Apache Pulsar client for Scala built on top of Fs2
Stars: ✭ 53 (-69.54%)
Mutual labels:  typelevel, fp
Skunk
A data access library for Scala + Postgres.
Stars: ✭ 1,107 (+536.21%)
Mutual labels:  typelevel, cats
tradeio
A disciplined way to purely functional domain models in Scala
Stars: ✭ 19 (-89.08%)
Mutual labels:  cats, fp
fs2-ssh
A wrapper around Apache SSHD targeting cats-effect and fs2
Stars: ✭ 36 (-79.31%)
Mutual labels:  cats, fp
scala-functional-programming-tutorial
Functional Programming in Scala Tutorial
Stars: ✭ 23 (-86.78%)
Mutual labels:  cats, fp
Scala Pet Store
An implementation of the java pet store using FP techniques in scala
Stars: ✭ 812 (+366.67%)
Mutual labels:  typelevel, cats
typelevel-stack.g8
📚 Unofficial Giter8 template for the Typelevel Stack (Http4s / Doobie / Circe / Cats Effect / Fs2) based on Cats v1.x.x
Stars: ✭ 63 (-63.79%)
Mutual labels:  cats, typelevel
tutorials
🎥 Source code of the examples shown in the video tutorials
Stars: ✭ 18 (-89.66%)
Mutual labels:  cats, fp
Stm4cats
STM monad for cats-effect
Stars: ✭ 35 (-79.89%)
Mutual labels:  cats, fp
Monocle
Optics library for Scala
Stars: ✭ 1,357 (+679.89%)
Mutual labels:  typelevel, cats

Hammock

Typelevel incubator Join the chat at https://gitter.im/pepegar/hammock Build Status codecov Maven Central

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

  1. It's easy to use, has a high level API
  2. It's typeful, tries to represent effects at type level.
  3. 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].
  4. It has good documentation.
  5. It's modular

Modules

Module name Description Version
hammock-core the core functionality of hammock, using XHR in JS 0.10.0
hammock-circe encode and decode HTTP entities with Circe 0.10.0
hammock-apache-http run your HTTP requests with Apache HTTP commons 0.10.0
hammock-akka-http run your HTTP requests with akka-http 0.10.0
hammock-asynchttpclient run your HTTP requests with AsyncHttpClient 0.10.0

How does Hammock look in action?

import cats.effect.IO
import hammock._
import hammock.marshalling._
import hammock.apache.ApacheInterpreter
import hammock.circe.implicits._

object HttpClient {
  // Using the Apache HTTP commons interpreter
  implicit val interpreter = ApacheInterpreter.instance[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]
}

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].