llhttp
llhttp copied to clipboard
http_status
Hi,
we tried to move from http_parser to llhttp. Is it possible to provide a http_status
, too?
Hello!
Do you mean the methods for converting status code to string?
FWIW, llhttp_get_status_code
can be used to get the status code out of the parser.
Yes, I mean the enum to provide STATUS::OK instead of 200 and so on to avoid mistake with a wrong int.
How can I do something like this? There is no HTTP_STATUS_ anymore.
int statusCode = llhttp_get_status_code();
if (statusCode == HTTP_STATUS_OK)
{
...
}
We can import statuses from https://github.com/nodejs/http-parser/blob/main/http_parser.h - Will send a PR soon!
LMK if you'd like any help with that!
@pallas Can you review the PR above?