Closed seghcder closed 4 years ago
Helper functions like status_bad_request
were created for cases when a user doesn't want to specify own error description. If a custom error description is necessary then underlying http_status_line_t
object can be constructed directly. For example:
auto status = restinio::http_status_line_t{
restinit::status_code::bad_request,
"Only Basic authorization currently supported"
};
or
restinio::http_status_line_t status{
restinit::status_code::bad_request,
"Only Basic authorization currently supported"
};
Got it :-)
Small suggestion - It would be good if instead of:
we could do this:
However I also read that HTTP/2 does away with text reason phrases: https://github.com/http2/http2-spec/issues/202 ... so if you are planning http/2 support soon then it might not be worth it.