libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.49k stars 922 forks source link

parallelized http get/post request with trying best to reuse connections? #1044

Closed bethebest0622 closed 5 months ago

bethebest0622 commented 5 months ago

Is your feature request related to a problem?

I am very careful for latency.

so the best solution i come out with is:

I want to http request try best to reuse the previous connections.

parallelized handle the http get/post request with a pool and this parallelized request reuse previous connections so that can avoid rebuild the connection.

Is cpr can implement this?

Possible Solution

add some setting or config

COM8 commented 5 months ago

To reuse a connection, try using cpr::Session. More docs are available here: https://docs.libcpr.org/advanced-usage.html#session-objects