Last active
November 27, 2015 01:40
-
-
Save ck196/04b723d2c7aaebc4e587 to your computer and use it in GitHub Desktop.
Play WS standalone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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