Skip to content

Instantly share code, notes, and snippets.

@joshuakfarrar
Created November 25, 2022 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuakfarrar/0048f6c93808ca7cdf6bba6f52516bed to your computer and use it in GitHub Desktop.
Save joshuakfarrar/0048f6c93808ca7cdf6bba6f52516bed to your computer and use it in GitHub Desktop.
val scala3Version = "3.1.0"
val http4sVersion = "1.0.0-M34"
val circeVersion = "0.15.0-M1"
lazy val root = project
.in(file("."))
.settings(
name := "social n' stuff",
version := "0.1.0-SNAPSHOT",
scalaVersion := scala3Version,
libraryDependencies ++= Seq(
"com.novocode" % "junit-interface" % "0.11" % "test",
"org.typelevel" %% "cats-core" % "2.7.0",
"org.typelevel" %% "cats-effect" % "3.3.4",
"org.http4s" %% "http4s-ember-client" % http4sVersion,
"org.http4s" %% "http4s-circe" % http4sVersion,
"org.http4s" %% "http4s-dsl" % http4sVersion
)
)
package gov.dhs.dsa
import cats.effect.{IO, IOApp, ExitCode}
import cats.implicits._
import org.http4s._
import org.http4s.implicits._
import org.http4s.ember.client._
import org.http4s.client.dsl.io._
import org.http4s.Method._
object Hello extends IOApp {
override def run(args: List[String]) = for {
test <- EmberClientBuilder.default[IO].build.use { client =>
client.expect[String](POST(UrlForm(
"client_key" -> clientKey,
"client_secret" -> clientSecret,
"access_token" -> accessToken
),
uri""))
}
_ <- IO { println(test) }
} yield ExitCode.Success
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment