Last active
March 1, 2020 15:21
-
-
Save hakuch/1cd0bdc051bf9d7e8e41 to your computer and use it in GitHub Desktop.
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 akka.http.scaladsl.model._ | |
import akka.stream._ | |
import scala.concurrent.duration._ | |
import scala.concurrent._ | |
object Http { | |
def responseBodyAsString(r: HttpResponse)(implicit m: Materializer): String = | |
Await.result( | |
r.entity.dataBytes.runWith(Sink.head).map(_.utf8String), | |
Duration.Inf) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ktoso could you have a look at the query below. have the same question. thanks in advance.