1
0
mirror of synced 2025-04-21 22:25:55 +03:00

Merge pull request #231 from sux2mfgj/fix_the_sample

Fix a sample code of multipart/form-data POST data in the README.md.
This commit is contained in:
yhirose 2019-10-03 13:42:31 -04:00 committed by GitHub
commit 5edf455d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,12 +77,13 @@ svr.set_error_handler([](const auto& req, auto& res) {
```cpp
svr.Post("/multipart", [&](const auto& req, auto& res) {
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");
// file.filename;
// 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