Commit 31f24e98 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Added httpp_get_param() which does POST, then queryparams

parent 937268e2
......@@ -596,6 +596,16 @@ const char *httpp_get_post_param(http_parser_t *parser, const char *name)
return _httpp_get_param(parser->postvars, name);
}
const char *httpp_get_param(http_parser_t *parser, const char *name)
{
const char *ret = _httpp_get_param(parser->postvars, name);
if (ret)
return ret;
return _httpp_get_param(parser->queryvars, name);
}
void httpp_clear(http_parser_t *parser)
{
parser->req_type = httpp_req_none;
......
......@@ -106,6 +106,7 @@ void httpp_set_query_param(http_parser_t *parser, const char *name, const char *
const char *httpp_get_query_param(http_parser_t *parser, const char *name);
void httpp_set_post_param(http_parser_t *parser, const char *name, const char *value);
const char *httpp_get_post_param(http_parser_t *parser, const char *name);
const char *httpp_get_param(http_parser_t *parser, const char *name);
void httpp_destroy(http_parser_t *parser);
void httpp_clear(http_parser_t *parser);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment