Httpc: send multiple requests using the same connection

Hi guys,

I’m currently using httpc to fetch 3x JSON data.
For every JSON, I’m calling httpc:request/4. Not sure if it’s the best way :-/

Ideally, I’d like to reuse the same connection for all 3x requests.

How can i make sure the TCP connection is not closed (Keep-Alive)?

Best

1 Like
httpc:set_options([..., {keep_alive_timeout, KeepAliveTimeoutMS},...]).

But AFAIR keep-alive is only request to server and server may ignore it.

1 Like

@Led thank you very much

1 Like