Browse Source

Merge pull request #231 from sux2mfgj/fix_the_sample

Fix a sample code of multipart/form-data POST data in the README.md.
yhirose 6 years ago
parent
commit
5edf455d72
1 changed files with 4 additions and 3 deletions
  1. 4 3
      README.md

+ 4 - 3
README.md

@@ -77,12 +77,13 @@ svr.set_error_handler([](const auto& req, auto& res) {
 ```cpp
 ```cpp
 svr.Post("/multipart", [&](const auto& req, auto& res) {
 svr.Post("/multipart", [&](const auto& req, auto& res) {
     auto size = req.files.size();
     auto size = req.files.size();
-    auto ret = req.has_file("name1"));
+    auto ret = req.has_file("name1");
     const auto& file = req.get_file_value("name1");
     const auto& file = req.get_file_value("name1");
     // file.filename;
     // file.filename;
     // file.content_type;
     // file.content_type;
-    auto body = req.body.substr(file.offset, file.length));
-})
+    auto body = req.body.substr(file.offset, file.length);
+});
+
 ```
 ```
 
 
 ### Stream content with Content provider
 ### Stream content with Content provider