1
0
mirror of synced 2025-04-20 11:47:43 +03:00

Fixed README

This commit is contained in:
yhirose 2019-07-23 08:11:41 -04:00
parent e0d327558d
commit eaffe68c1a

View File

@ -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&note=coder", "application/x-www-form-urlencoded"); res = cli.Post("/person", "name=john1&note=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++