gpt4 book ai didi

c++ - Wt C++ - 将 GET 值添加到 URL

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:22 26 4
gpt4 key购买 nike

我能否将 GET 值添加到机智库中的 URL,例如:www.somewebsite.com?SomeSuperValue=12&other=something?

最佳答案

我从未尝试过,但我认为这可能会成功:

#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];
}

如果您使用 C++,您还可以将 WEnvironment& env 作为 WApplication 类重载的参数。

编辑:我刚刚对其进行了测试并且它有效!

关于c++ - Wt C++ - 将 GET 值添加到 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10860742/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com