jeremycw / httpserver.h

Single header library for writing non-blocking HTTP servers in C
MIT License
1.78k stars 143 forks source link

Add helper regarding the request URL #39

Open ioppermann opened 4 years ago

ioppermann commented 4 years ago

For routing a request, the URL without the query string is usually required. The method http_request_path() returns the path component of the URL (i.e. everything befor the first "?") and the method http_request_querystring() returns the query string components of the URL (i.e. everything after the first "?").

The method http_request_query() returns the value of a given key in the query. The method http_request_iterate_query() iterates over all query keys.