Fixed README
This commit is contained in:
parent
e0d327558d
commit
eaffe68c1a
15
README.md
15
README.md
@ -8,8 +8,6 @@ A C++ header-only cross platform HTTP/HTTPS library.
|
|||||||
|
|
||||||
It's extremely easy to setup. Just include **httplib.h** file in your code!
|
It's extremely easy to setup. Just include **httplib.h** file in your code!
|
||||||
|
|
||||||
Inspired by [Sinatra](http://www.sinatrarb.com/) and [express](https://github.com/visionmedia/express).
|
|
||||||
|
|
||||||
Server Example
|
Server Example
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
@ -110,9 +108,9 @@ int main(void)
|
|||||||
|
|
||||||
```c++
|
```c++
|
||||||
httplib::Headers headers = {
|
httplib::Headers headers = {
|
||||||
{ "Content-Length", "5" }
|
{ "Accept-Encoding", "gzip, deflate" }
|
||||||
};
|
};
|
||||||
auto res = cli.Post("/validate-no-multiple-headers", headers, "hello", "text/plain");
|
auto res = cli.Get("/hi", headers);
|
||||||
```
|
```
|
||||||
|
|
||||||
### GET with Content Receiver
|
### GET with Content Receiver
|
||||||
@ -132,6 +130,15 @@ res = cli.Post("/post", "text", "text/plain");
|
|||||||
res = cli.Post("/person", "name=john1¬e=coder", "application/x-www-form-urlencoded");
|
res = cli.Post("/person", "name=john1¬e=coder", "application/x-www-form-urlencoded");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### POST with HTTP headers
|
||||||
|
|
||||||
|
```c++
|
||||||
|
httplib::Headers headers = {
|
||||||
|
{ "Content-Length", "5" }
|
||||||
|
};
|
||||||
|
auto res = cli.Post("/hi", headers, "hello", "text/plain");
|
||||||
|
```
|
||||||
|
|
||||||
### POST with parameters
|
### POST with parameters
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
|
Loading…
x
Reference in New Issue
Block a user