Yogesh patel
Yogesh patel

Reputation: 1371

How to get row POST request data from fastcgi++

How can I get Row POST request data from client using Fastcgi++ library and show it on web page.

I Tried the example below

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

But I want to see ROW Post data Not in the form of std::map but a std::string .

Upvotes: 1

Views: 379

Answers (0)

Related Questions