This is a ScalaJS facade for Axios.
Step 1. Add JitPack to your repositories in SBT:
resolvers += "jitpack" at "https://jitpack.io"
Step 2. Add this repo as a dependency:
libraryDependencies += "blog.codeninja" % "scala-js-axios" % "0.16.1"
If you'd like the latest-and-greatest version, use "master-SNAPSHOT".
Perform a simple HTTP get, wait for it, and print the response.
import scala.scalajs.js
import blog.codeninja.scalajs.axios._
object Example {
def main(args: Array[String]) = {
Axios.get("http://www.google.com", literal(
data = js.Dictionary[String]("q" -> "scalajs")
))
}
}
You should be ready to roll...
If you find a bug or have suggestions on how to improve the facade (specifically adding some more type safety where possible), please open an issue and tell me about it.
Hope you find this helpful!