UrlParams.hpp
Get an unordered_map containing url query key/value parameters.
Functions
-
std::multimap<std::string, vector<std::string>> GetUrlParams()
Extracts the query portion of a url and parses for key value pairs.
Some esoterica: “?string=this+that” and “?string=this&string=that” have different meanings and may result in different behavior. Similarly “?test” becomes [[“test”]] while “?test=” becomes [[“test”, “”]].
Note
In a query space encoded by “%20” is interpreted as a space character while the space encoded by “+” is used to separate a list of values for a key. For example querying “?seed=100&strings=hi%20there+blah” will be parsed to the parameter array [[“seed”, “100”], [“strings”, “hi there”, “blah”]] then converted to a multimap.