小编use*_*950的帖子

Akka HTTP 客户端 EntityStreamSizeException

我尝试使用 Akka HTTP 向本地主机发送 get 请求,但出现以下异常:

EntityStreamSizeException: actual entity size (Some(10166731700)) exceeded content length limit (8388608 bytes)! You can configure this by setting akka.http.[server|client].parsing.max-content-length or calling HttpEntity.withSizeLimit before materializing the dataBytes stream.)
Run Code Online (Sandbox Code Playgroud)

基本上,我尝试请求的本地主机上的文件非常大。

我尝试使用 来解决它withoutSizeLimit,但它不起作用:

val request = Get("http://localhost:8080/oa-ok.ntriples")
val limitedRequest = request.withEntity(request.entity.withoutSizeLimit())
val responseFuture = Http().singleRequest(limitedRequest)
Run Code Online (Sandbox Code Playgroud)

我也尝试使用withSizeLimit,但没有帮助。有任何想法吗?

scala akka akka-stream akka-http

2
推荐指数
1
解决办法
1626
查看次数

标签 统计

akka ×1

akka-http ×1

akka-stream ×1

scala ×1