How to use .withoutSizeLimit in Akka-http (client) HttpRequest?
<p>I'm using Akka 2.4.7 to read a web resource that is essentially a stream of JSON objects, delimited with newlines. The stream is practically unlimited in size.</p>

<p>When around 8MB has been consumed, I get an exception:</p>

<pre><code>[error] (run-main-0) EntityStreamSizeException: actual entity size (None) 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.
</code></pre>

<p>The "actual entity size (None)" seems a bit funny, but my real question is, how to use the <code>HttpEntity.withSizeLimit</code> (or in my case, rather <code>.withoutSizeLimit</code> that should be there, as well).</p>

<p>My request code is like this:</p>

<pre><code>val chunks_src: Source[ByteString,_] = Source.single(req)
  .via(connection)
  .flatMapConcat( _.entity.dataBytes )
</code></pre>

<p>I tried adding a <code>.map( (x: HttpResponse) =&gt; x.withoutSizeLimit )</code>, but it does not compile. What's the role of the <code>HttpEntity</code> when doing client side programming, anyways?</p>

<p>I can change the global config, but that's kind of missing the point. I'd like to flag "no limits" only for a particular request.</p>

<p>As a further question, I understand the need for a <code>max-content-length</code> on the server side, but why affect the client?</p>

<p>References: </p>

<ul>
<li>Akka 2.4.7: <a href="http://doc.akka.io/docs/akka/2.4.7/scala/http/common/http-model.html#Limiting_message_entity_length" rel="nofollow">Limiting message entity length</a></li>
<li>Akka 2.4.7: <a href="http://doc.akka.io/docs/akka/2.4.7/scala/http/common/http-model.html#HttpEntity" rel="nofollow">HttpEntity</a></li>
</ul>