@@ -235,7 +235,7 @@ svr.set_exception_handler([](const auto& req, auto& res, std::exception_ptr ep)
235235 snprintf(buf, sizeof(buf), fmt, "Unknown Exception");
236236 }
237237 res.set_content(buf, "text/html");
238- res.status = 500 ;
238+ res.status = StatusCode::InternalServerError_500 ;
239239});
240240```
241241
@@ -385,14 +385,14 @@ By default, the server sends a `100 Continue` response for an `Expect: 100-conti
385385``` cpp
386386// Send a '417 Expectation Failed' response.
387387svr.set_expect_100_continue_handler([](const Request &req, Response &res) {
388- return 417 ;
388+ return StatusCode::ExpectationFailed_417 ;
389389});
390390```
391391
392392``` cpp
393393// Send a final status without reading the message body.
394394svr.set_expect_100_continue_handler([](const Request &req, Response &res) {
395- return res.status = 401 ;
395+ return res.status = StatusCode::Unauthorized_401 ;
396396});
397397```
398398
@@ -473,7 +473,7 @@ int main(void)
473473 httplib::Client cli("localhost", 1234);
474474
475475 if (auto res = cli.Get("/hi")) {
476- if (res->status == 200 ) {
476+ if (res->status == StatusCode::OK_200 ) {
477477 std::cout << res->body << std::endl;
478478 }
479479 } else {
@@ -623,7 +623,7 @@ std::string body;
623623auto res = cli.Get(
624624 "/stream", Headers(),
625625 [&](const Response &response) {
626- EXPECT_EQ(200 , response.status);
626+ EXPECT_EQ(StatusCode::OK_200 , response.status);
627627 return true; // return 'false' if you want to cancel the request.
628628 },
629629 [&](const char *data, size_t data_length) {
0 commit comments