sbt-curl is a sbt plugin to run curl commands in sbt.
With this plugin, you can test your api directly with curl in sbt.
- Run curl command directly in sbt, like
> curl www.google.com
. - Run a file of curl commands by
sbt curlTest
, it will execute the curl-test script defined in your project. See the example.
(TBD): Potentially add an eDSL to facilitate testing APIs with curl and expect commands, similar to the functionality in Cypress.
Add the plugin:
resolvers += Resolver.url("GitHub Package Registry", url("https://maven.pkg.github.com/reminia/_"))(
Resolver.ivyStylePatterns
)
credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"_",
System.getenv("GITHUB_TOKEN")
)
addSbtPlugin("me.yceel" % "sbt-curl" % "0.1.1")
You can:
- run curl command directly in your sbt REPL.
- run
curlTest
to execute all curl commands in the curl-script.
Curl script is a file namedcurl-script
orcurl-test
under root directory or root/project directory.
Check the project api for reference.