mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-15 19:13:39 +00:00
Added client methods with shared pointer to Response.
This commit is contained in:
1 parent
d187cdef50
commit
3c8c835489
4 files changed
+72
-6
No files matched your search
+5
-5
@@ -17,11 +17,11 @@ int main(void)
|
||||
|
||||
Client cli("localhost", 8080);
|
||||
|
||||
Response res;
|
||||
if (cli.get(hi, res)) {
|
||||
cout << res.status << endl;
|
||||
cout << res.get_header_value("Content-Type") << endl;
|
||||
cout << res.body << endl;
|
||||
auto res = cli.get(hi);
|
||||
if (res) {
|
||||
cout << res->status << endl;
|
||||
cout << res->get_header_value("Content-Type") << endl;
|
||||
cout << res->body << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user