开发者

apache and cgicc - differentiate between post and get variables

In PHP it is very simple to check, if a variable has been transmitted via GET or POST. With the cgicc library they all look the same. Is there another possibility to read only GET or only POST 开发者_Python百科variables?

My Code:

cgicc:Cgicc cgiobj;
std::cout << "Both, post or get: " << cgiobj("variablename") << std::endl;


I had the same question so I looked for a solution in the cgicc documentation. Class CgiEnvironment provides getRequestMethod() which returns "GET" or "POST" accordingly to your request.

eg.

cgicc::Cgicc cgi;
cgicc::CgiEnvironment env = cgi.getEnvironment();
std::string requestMethod = env.getRequestMethod();

I have not tested it, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜