[erlang-questions] httpc sending empty te header

Ingela Andin <>
Thu Apr 1 08:56:29 CEST 2010


2010/3/31 Vincent de Phily <>:
> Hi,
> the inets http client seems to add an empty "te:" http headers in all
> requests. At first I thought it was a bug, but looking at the code of
> httpc:validate_headers/3 it seems like it was done on purpose.
> So a few questions about this :
> * Is it indeed the intended behaviour ? What's the purpose ?

The inets http client has been quite extensively rewritten since the
it was first contributed and is still evolving. However this
particular feature has been there since the start I think, and the
behavior is currently documented in the inets users guide.  I guess it
was viewed as a good default as the only currently supported
transfer-encoding is chunked.

>From HTTP rfc:  "If the TE field-value is empty or if no TE field is
present, the only transfer-coding is "chunked""

> * Shouldn't httpc provide a default value (whatever transfer encodings httpc
>  does support) instead ?

The empty te-header does work as a default as it will only be added if the
user has not specified a value for the te-header.  Of course since other
transfer-encodings currently are not supported anything but default is not
so useful.

> * What's the usefull difference between the "accept-encoding" and the "te"
>  headers ?

The first one concerns content encoding the second one transfer encoding.

Regards Ingela Erlang/OTP-team Ericsson

More information about the erlang-questions mailing list