c++cppcms

Display parameters in cppcms GET or POST request


How to get the parameters list from cppcms GET or POST URI's ? For example :

GET uri_servicename?param1=value1

I want to extract this param1 and value1 if they exist in the URI.

Edit: I wanted to save them as variables.


Solution

  • Got to know a method called query_string() under <cppcms/http_request.h> which gives the whole query string including all parameters and values in the http request.

    We can use it as:

    std::string paramlist = request().query_string();
    

    Reference:

    http://cppcms.com/cppcms_ref/latest/classcppcms_1_1http_1_1request.html