如何使用Fastcgi ++库从客户端获取Row POST请求数据并在网页上显示。
我试过下面的例子
out << "<h1>POST Data</h1>";
if(environment().posts.size())
{
for(Http::Environment<wchar_t>::Posts::const_iterator it=environment().posts.begin(); it!=environment().posts.end(); ++it)
{
out << "<h2>" << encoding(HTML) << it->first << encoding(NONE) << "</h2>";
if(it->second.type==Http::Post<wchar_t>::form)
{
out << "<p><b>Type:</b> form data<br />";
out << "<b>Value:</b> " << encoding(HTML) << it->second.value << encoding(NONE) << "</p>";
}
else
{
out << "<p><b>Type:</b> file<br />";
out << "<b>Filename:</b> " << encoding(HTML) << it->second.filename << encoding(NONE) << "<br />";
out << "<b>Content Type:</b> " << encoding(HTML) << it->second.contentType << encoding(NONE) << "<br />";
out << "<b>Size:</b> " << it->second.size << "<br />";
out << "<b>Data:</b></p><pre>";
out.dump(it->second.data.get(), it->second.size);
out << "</pre>";
}
}
}
else
out << "<p>No POST data</p>";
out << "</body></html>";
return true;
}
但我想看看ROW Post数据不是std :: map的形式,而是std :: string。