Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.52 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.52 KB

Playground for cpr extensions

See https://github.com/libcpr/cpr

Tries the following:

  • Factory to store named sets of standard Session configurations (baseURL, Header, Parameters, Redirects, HTTP proxies)
  • All Session objects created share DNS, connection, SSL and cookie cache
  • Sessions are configured with a retry policy with backof
  • Can invoke verbs (Get, etc) with relative URLs, otherwise same parameters as cpr
  • Proxy autodiscovery via libproxy
  • proxy connectivity test on session creation
  • during request retries optionally try connects w/o proxy

It provides a class cprex::Session utilizing cpr::Session.

No MultiPerform yet.

Basic use:

cprex::Factory::PrepareSession("ipify", "https://api64.ipify.org");
cprex::Factory::PrepareSession("stat", "https://httpstat.us/");
...
auto ipify = cprex::Factory::CreateSession("ipify");
auto r = ipify.Get("/");
...
auto stat = cprex::Factory::CreateSession("stat");
r = stat.Get("/200");

Some parameter:

r = stat.Get("/200", cpr::Parameters {{"sleep", "5000"}});

TODOs: