Updated Repl.it examples
This commit is contained in:
parent
db075d8cf9
commit
3e4567bae8
@ -12,7 +12,7 @@ NOTE: This is a 'blocking' HTTP library. If you are looking for a 'non-blocking'
|
|||||||
Simple examples
|
Simple examples
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
### [Server](https://repl.it/@yhirose/cpp-httplib-server#main.cpp):
|
#### Server
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
httplib::Server svr;
|
httplib::Server svr;
|
||||||
@ -24,7 +24,7 @@ svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) {
|
|||||||
svr.listen("0.0.0.0", 8080);
|
svr.listen("0.0.0.0", 8080);
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Client](https://repl.it/@yhirose/cpp-httplib-client#main.cpp):
|
#### Client
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
httplib::Client cli("http://cpp-httplib-server.yhirose.repl.co");
|
httplib::Client cli("http://cpp-httplib-server.yhirose.repl.co");
|
||||||
@ -35,6 +35,11 @@ res->status; // 200
|
|||||||
res->body; // "Hello World!"
|
res->body; // "Hello World!"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Try out the examples on Repl.it!
|
||||||
|
|
||||||
|
1. Run server at https://repl.it/@yhirose/cpp-httplib-server
|
||||||
|
2. Run client at https://repl.it/@yhirose/cpp-httplib-client
|
||||||
|
|
||||||
Server
|
Server
|
||||||
------
|
------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user