Skip to content

Instantly share code, notes, and snippets.

@w1shen
Last active April 18, 2017 03:40
Show Gist options
  • Save w1shen/e4f1c539a0ed10910d3e to your computer and use it in GitHub Desktop.
Save w1shen/e4f1c539a0ed10910d3e to your computer and use it in GitHub Desktop.
Post JSON by Dispatch
val req = url("localhost").POST
.as_!("username", "password")
.setBody("body")
.setContentType("application/json", "UTF-8")
val future = Http(req OK as.String)
val rep = Await.result(future, 5.seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment