Skip to content

Instantly share code, notes, and snippets.

@ck196
Last active November 27, 2015 01:40
Show Gist options
  • Save ck196/04b723d2c7aaebc4e587 to your computer and use it in GitHub Desktop.
Save ck196/04b723d2c7aaebc4e587 to your computer and use it in GitHub Desktop.
Play WS standalone
name := """play-ws-standalone"""
version := "1.0"
scalaVersion := "2.11.7"
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
// Play-json standalone
libraryDependencies += "com.typesafe.play" % "play-json_2.11" % "2.4.4"
libraryDependencies += "com.typesafe.play" % "play-ws_2.11" % "2.4.4"
import play.api.libs.ws.ning._
import play.api.libs.ws._
import play.api.libs.concurrent.Execution.Implicits
object Sample {
def main(args: Array[String]) {
implicit val client = NingWSClient()
implicit val context = Implicits.defaultContext
// close with sslClient.close() when finished with client
val response = WS.clientUrl("http://google.com/").get().foreach {
x => {print(x.body)}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment