title: How can I create a HTTP POST request with Qt 4.6.1?
body: <p>How can I create a HTTP POST request with some URL encoded parameters using Qt 4.6.1?</p>
  
  <p>I figured out that I can create a QNetworkRequest, set all the parameters there and send it via QNetworkAccessManagers post method. But how can I add some URL-encoded parameters to the request?</p>
  
  <p>In the end I want to access the <a href="http://en.wikipedia.org/wiki/Eve_Online#Third-party_applications_and_the_Eve_API_Project" rel="noreferrer">Eve API</a> using Qt/C++. A Python example can be found here:
  <a href="http://www.eveonline.com/api/doc/example-python.asp" rel="noreferrer">http://www.eveonline.com/api/doc/example-python.asp</a></p>
  
  <hr>
  
  <p>I managed it using something like (still to be refactored and formed into something useful):</p>
  
  <pre><code>QNetworkReply *requestApi(QNetworkAccessManager &amp;nwam)
  {
  
      QNetworkRequest request(QUrl("http://api.eve-online.com/account/Characters.xml.aspx"));
      request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded");
  
      QByteArray data;
      QUrl params;
  
      params.addQueryItem("userid","user");
      params.addQueryItem("apiKey","key");
      data.append(params.toString());
      data.remove(0,1);
  
      QNetworkReply *reply = nwam.post(request,data);
      return reply;
  }
  </code></pre>