src/services/httpparsing.cpp
/**
 * Parses a query string into a given Params structure.
 */
Parses a query string into a given Params structure.
Parses a query string into a given Params structure .
void parseQuery(const std::string& query, Parameters &params) {
	if (query.length() == 0)
		return;
	Poco::URI uri;
	uri.setRawQuery(query);
	auto queryParameters = uri.getQueryParameters();
	for(auto &parameter : queryParameters){
        std::transform(parameter.first.begin(), parameter.first.end(), parameter.first.begin(), ::tolower);
		params.insert(std::make_pair(parameter.first, parameter.second));
	}
}
void parseQuery ( const std :: string & query , Parameters & params ) { if ( query . length ( ) == 0 ) return ; Poco :: URI uri ; uri . setRawQuery ( query ) ; auto queryParameters = uri . getQueryParameters ( ) ; for ( auto & parameter : queryParameters ) { std :: transform ( parameter . first . begin ( ) , parameter . first . end ( ) , parameter . first . begin ( ) , :: tolower ) ; params . insert ( std :: make_pair ( parameter . first , parameter . second ) ) ; } }
Parses a query string into a given Params structure.
Parses a query string into a given Params structure .
//setRawQuery instead of setQuery because setQuery will encode the given string, but here it is already encoded.