Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wt C++ - adding GET values to the URL

Tags:

c++

get

wt

Am I able to add GET values to the URL in witty library, like: www.somewebsite.com?SomeSuperValue=12&other=something ?

like image 661
Pan Jan Avatar asked Nov 04 '22 22:11

Pan Jan


1 Answers

I never tried but I think this might do it:

#include <Wt/WEnvironment>

const WEnvironment& env = WApplication::instance()->environment();
   ...
 // read an application startup argument 
 // (passed as argument in the URL or POST'ed to the application).
 if (!env.getParameterValues("login").empty())
 {
   std::string login = env.getParameterValues("login")[0];
 }

you also have the WEnvironment& env as a parameter of the WApplication class overload, if you use c++.

EDIT: I just tested it and it works!

like image 88
Pedro Ferreira Avatar answered Nov 15 '22 04:11

Pedro Ferreira