1
0
mirror of synced 2025-07-25 01:22:03 +03:00
This commit is contained in:
yhirose
2020-02-11 00:26:15 -05:00
parent b251668522
commit ca5a50d2c9
2 changed files with 49 additions and 3 deletions

View File

@ -106,7 +106,7 @@ svr.set_logger([](const auto& req, const auto& res) {
});
```
### Error Handler
### Error handler
```cpp
svr.set_error_handler([](const auto& req, auto& res) {
@ -232,6 +232,24 @@ svr.new_task_queue = [] {
};
```
### 'Expect: 100-continue' handler
As default, the server sends `100 Continue` response for `Expect: 100-continue` header.
```cpp
// Send a '417 Expectation Failed' response.
svr.set_expect_100_continue_handler([](const Request &req, Response &res) {
return 417;
});
```
```cpp
// Send a final status without reading the message body.
svr.set_expect_100_continue_handler([](const Request &req, Response &res) {
return res.status = 401;
});
```
Client Example
--------------