在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:libcpr/cpr开源软件地址:https://github.com/libcpr/cpr开源编程语言:C++ 92.6%开源软件介绍:C++ Requests: Curl for PeopleAnnouncements
TLDRC++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project. Despite its name, libcurl's easy interface is anything but, and making mistakes misusing it is a common source of error and frustration. Using the more expressive language facilities of C++11, this library captures the essence of making network calls into a few concise idioms. Here's a quick GET request: #include <cpr/cpr.h>
int main(int argc, char** argv) {
cpr::Response r = cpr::Get(cpr::Url{"https://api.github.com/repos/whoshuu/cpr/contributors"},
cpr::Authentication{"user", "pass", cpr::AuthMode::BASIC},
cpr::Parameters{{"anon", "true"}, {"key", "value"}});
r.status_code; // 200
r.header["content-type"]; // application/json; charset=utf-8
r.text; // JSON text string
return 0;
} And here's less functional, more complicated code, without cpr. Documentation
FeaturesC++ Requests currently supports:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论