cURL / Mailing Lists / curl-library / Single Mail

curl-library

Simple multiple field get using application/x-www-form-urlencoded

From: Ulf Samuelsson <curl_at_emagii.com>
Date: Fri, 27 Sep 2013 14:30:41 +0200

Want to create a query with multiple fields, and get the result in a C++
string

Example: "http://www.myserver.com?field=1&field=2&field=3"

The server need the query to be of the form
"application/x-www-form-urlencoded".

Tried using cURLpp

             curlpp::Forms formParts;
             formParts.push_back(new
curlpp::FormParts::Content("Type", "1"));
             formParts.push_back(new
curlpp::FormParts::Content("DeviceName", "CGNS_emagii"));
             formParts.push_back(new
curlpp::FormParts::Content("NodeType", "9700"));
             request.setOpt(new curlpp::options::HttpPost(formParts));

But that generates a multiple form query, and not "x-www-form-urlencoded"
so the server will give an empty reply.

Have been looking for a good example, but have not yet found it.
A libcurl or curlpp solution will do for me?

BR
Ulf Samuelsson

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-09-27