Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active June 7, 2019 09:30
Show Gist options
  • Save adamw/b269bf4960b80be03cc85d8d7f26cd19 to your computer and use it in GitHub Desktop.
Save adamw/b269bf4960b80be03cc85d8d7f26cd19 to your computer and use it in GitHub Desktop.
/*
SBT dependencies:
val sttpVersion = "1.5.19"
libraryDependencies += Seq(
"com.softwaremill.sttp" %% "core" % sttpVersion,
"com.softwaremill.sttp" %% "circe" % sttpVersion,
)
*/
import com.softwaremill.sttp._
import com.softwaremill.sttp.circe._
import io.circe.generic.auto._
case class Person(name: String, age: Int)
val request = sttp
.post(uri"http://httpbin.org/post")
.body(Person("Mary", 52))
.header("X-Auth", "123")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment