I'm trying to stream a response from a server via the inets client, using a call like this:<br><br>httpc:request(<URL Parameters,etc.>,[{headers_as_is, true},{sync,false},{stream,self}])),<br><br>200 responses seem to follow the proper work flow, but, when I receive a non-2xx response I either get messages like this:<br>
<br>(1) {http, {RequestId, {status_line(), headers(), body()}}, <br><br>which seems to be expected as per this previous mailing list conversation - <a href="http://erlang.org/pipermail/erlang-bugs/2009-March/001222.html">http://erlang.org/pipermail/erlang-bugs/2009-March/001222.html</a><br>
<br>or I'll get a message that just drops right into a stream atom clause:<br><br>(2) {http, {RequestId,stream,BinBodyPart}} -><br><br>which is unusual, because I thought only (1) should be returned for non-2xx responses. As a result, I have to first check to see if I receive a stream_start atom or a stream atom first to differentiate between 2xx and non-2xx responses. This is always followed up with a {http, {RequestId, {status_line(), headers(), <<>>}}<br>
<br>I haven't been able to figure out what type of response causes to me get a type (1) message and what causes me to get a type (2).<br><br>In addition, sometimes (1) doesn't function as expected either - I'll receive a body that doesn't match the content length, and even if I try and drop into a receive to capture the rest of the body, I never get any messages. Am I missing an option when calling the client?<br>
<br>I'm running 14A, for what it's worth.<br><br>Thanks, <br><br>Todd<br><br><br>