mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Updated README
This commit is contained in:
parent
f008fe4539
commit
e42a358da8
20
README.md
20
README.md
@ -173,6 +173,26 @@ svr.set_error_handler([](const auto& req, auto& res) {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Pre routing handler
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
svr.set_pre_routing_handler([](const auto& req, auto& res) -> bool {
|
||||||
|
if (req.path == "/hello") {
|
||||||
|
res.set_content("world", "text/html");
|
||||||
|
return true; // This request is handled
|
||||||
|
}
|
||||||
|
return false; // Let the router handle this request
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Post routing handler
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
svr.set_post_routing_handler([](const auto& req, auto& res) {
|
||||||
|
res.set_header("ADDITIONAL_HEADER", "value");
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### 'multipart/form-data' POST data
|
### 'multipart/form-data' POST data
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user