mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-24 05:29:12 +00:00
Added client methods with shared pointer to Response.
This commit is contained in:
parent
d187cdef50
commit
3c8c835489
4 changed files with 72 additions and 6 deletions
17
README.md
17
README.md
|
@ -24,4 +24,21 @@ Inspired by [Sinatra](http://www.sinatrarb.com/)
|
|||
svr.run();
|
||||
}
|
||||
|
||||
Client Example
|
||||
--------------
|
||||
|
||||
#include <httplib.h>
|
||||
#include <iostream>
|
||||
using namespace httplib;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Client cli("localhost", 1234);
|
||||
|
||||
auto res = cli.get("/hi");
|
||||
if (res && res->status == 200) {
|
||||
std::cout << res->body << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Copyright (c) 2012 Yuji Hirose. All rights reserved.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue