akka HttpResponse read body as String scala

前端 未结 7 994
广开言路
广开言路 2020-12-28 13:27

So I have a function with this signature (akka.http.model.HttpResponse):

def apply(query: Seq[(String, String)], accept: String): HttpResponse
7条回答
  •  星月不相逢
    2020-12-28 14:14

    You can also try this one also.

    responseObject.entity.dataBytes.runFold(ByteString(""))(_ ++ _).map(_.utf8String) map println
    

提交回复
热议问题