Created
October 1, 2016 09:53
-
-
Save jarek-przygodzki/f2519b06d722c53ce3cde66079cc5015 to your computer and use it in GitHub Desktop.
Play 2.5.x - example of simple standalone WSClient
This file contains 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.ahc.AhcWSClient | |
import akka.stream.ActorMaterializer | |
import akka.actor.ActorSystem | |
implicit val system = ActorSystem() | |
implicit val materializer = ActorMaterializer() | |
val ws = AhcWSClient() | |
val req = ws.url("http://example.com").get().map{ | |
resp => resp.body | |
}(system.dispatcher) | |
// after all futures completed... | |
ws.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment