From eaffe68c1a235d886d7331e2b4a9609044c7215a Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 23 Jul 2019 08:11:41 -0400 Subject: [PATCH] Fixed README --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc5a0ef..f19e0aa 100644 --- a/README.md +++ b/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! -Inspired by [Sinatra](http://www.sinatrarb.com/) and [express](https://github.com/visionmedia/express). - Server Example -------------- @@ -110,9 +108,9 @@ int main(void) ```c++ 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 @@ -132,6 +130,15 @@ res = cli.Post("/post", "text", "text/plain"); 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 ```c++