mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Refactoring.
This commit is contained in:
parent
f91cc98b89
commit
aa75fbb5f9
7 changed files with 100 additions and 79 deletions
|
@ -6,21 +6,23 @@
|
|||
//
|
||||
|
||||
#include <httplib.h>
|
||||
#include <cstdio>
|
||||
#include <signal.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace httplib;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
using namespace httplib;
|
||||
|
||||
const char* hi = "/hi";
|
||||
|
||||
Client cli("localhost", 1234);
|
||||
Client cli("localhost", 8080);
|
||||
|
||||
Response res;
|
||||
cli.get(hi, res);
|
||||
if (cli.get(hi, res)) {
|
||||
cout << res.status << endl;
|
||||
cout << res.get_header_value("Content-Type") << endl;
|
||||
cout << res.body << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue