Sure.
My C++ code is as follows:
std::stringstream out;
std::stringstream ss;
ss << "127.0.0.1/online.php";
try
{
curlpp::Cleanup clean;
curlpp::Easy request;
curlpp::options::WriteStream ws(&out);
request.setOpt(ws);
request.setOpt<curlpp::options::Url>(ss.str());
request.setOpt(new curlpp::options::Verbose(true));
std::list<std::string> header;
header.push_back("Content-Type: application/octet-stream");
request.setOpt(new curlpp::options::HttpHeader(header));
std::string test = "abcd=abcd";
request.setOpt(new curlpp::options::PostFields(test));
request.setOpt(new
curlpp::options::PostFieldSize(test.length()));
request.perform();
}
catch(curlpp::RuntimeError& e)
{
ss.str("");
ss << "Error making request of type " << op << ": " << e.what();
PrintError(ss.str());
return "";
}
std::cout << out.str() << std::endl;
return out.str();
And the web script end is just <? var_dump($_POST); ?> as mentioned
before. Command line curl has it print the sent data as expected.
Thanks,
Jeff
On Jul 22, 7:31 pm, Zach Mance <[email protected]> wrote:
> I've been able to use POST things, I'll try to help you. Could you
> post more of the code you are working with?
>
> Thanks,
> Zach
>
> On Jul 22, 8:31 am, Jeff Warrren <[email protected]> wrote:
>
>
>
>
>
>
>
> > I have been working off the example given
> > athttp://curlpp.org/index.php/examples/62-example-12,
> > along with a php script which will just print out whatever is posted
> > to it.
>
> > (i.e. <? var_dump($_POST) ?> )
>
> > No matter what I have tried, including variations on the example
> > above, the PHP script never seems to receive anything. Am I doing
> > something incorrectly, or is there possibly a bug in curlpp?
--
You received this message because you are subscribed to the Google Groups
"curlpp" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/curlpp?hl=en.