我正在使用 Spray API(spray-client) 来访问外部 URL,并且我得到了 gzipped HttpResponse。如何解压缩此 HttpResponse 以获取其实体(在我的情况下为 json)?
val future: Future[HttpResponse] = (IO(Http) ? Get(uri)).mapTo[HttpResponse]
val response = Await.result(future, Duration.inf)
val json = response.entity
在这里,json 被压缩。我如何解压缩它?