c++httpclientcpp-netlib

Is it possible to alter the HTTP client timeout period (cpp-netlib)?


I'm using cpp-netlib (v0.11.0) to send HTTP requests.

I'd like to know if it's possible to alter the timeout period when sending an HTTP POST request.

I'm running some unit tests, one of which sends an HTTP request to an address where there is no server running. An attempt to pull information from the response times-out after about 90s with the error "Operation timed out".


Solution

  • When the constructor for the client class is invoked, you can pass an options class that you can set the timeout in. See the docs for the client class constructors (and then scroll down a bit) for more specific information.