esp http client is too large
Posted: Tue Oct 09, 2018 4:37 pm
Currently, the default HTTP client in the component library is a monster. Instantiating it adds ~160kB of binary size when compiled with -Os (and this is likely multiplied 3x if using factory + 2 OTA partitions).
Looking at the code, it seems that it's using nghttp underneath and such library is a monster as well.
As far as I understand, it makes sense to have a HTTP client that's doing GET / POST over both HTTP and HTTPS, and also supporting redirect and chunked encoding. Provided we use it only synchronously, I think this would cover 95% of the use case.
Furthermore, we can limit header parsing to the status/request line, content type and finding the transfer encoding or content length to limit the binary size.
Would you be open to a simpler (smaller) http client inclusion in the repository ?
Looking at the code, it seems that it's using nghttp underneath and such library is a monster as well.
As far as I understand, it makes sense to have a HTTP client that's doing GET / POST over both HTTP and HTTPS, and also supporting redirect and chunked encoding. Provided we use it only synchronously, I think this would cover 95% of the use case.
Furthermore, we can limit header parsing to the status/request line, content type and finding the transfer encoding or content length to limit the binary size.
Would you be open to a simpler (smaller) http client inclusion in the repository ?