[erlang-questions] Are you using {packet, http} ?

Christian S chsu79@REDACTED
Wed Jul 23 15:14:54 CEST 2008

>> You change into plain mode after the end of headers arrive.
>> It is a little bit annoying that no chunked-mode body exists.
>> Implementable in erlang though.
> Thank you for your reply Christian,
> You mean It automatically swiches in? If we originally set [binary, {packet,
> http}] then after end of header to what form it will be swiches to.
>       for an example {packet, 0}
>       and are we getting the rest as {tcp, Socket, Bin}

No, you do
  inet:setopts(Sock, [{packet, raw}]),
when you get http_eoh

Find some code that uses this and read it. Suggested example:


Notice how it only sports an unencoded body (a size specified in a
content length header) and chunked encoding POSTing would make it cry.

More information about the erlang-questions mailing list