title: Qt Web Service post query
body: <p>I'm trying to use this <a href="http://www.rcsb.org/pdb/software/rest.do" rel="nofollow">http://www.rcsb.org/pdb/software/rest.do</a> REST services with Qt.
  I did some get requests with no problem, but when I try to do a post request to its advanced search(which is an XML web service), I get no response.</p>
  
  <p>This is the post request I'm trying:</p>
  
  <pre><code>&lt;orgPdbQuery&gt;
  
  &lt;queryType&gt;org.pdb.query.simple.StructureIdQuery&lt;/queryType&gt;
  
  &lt;description&gt;Simple query for a list of PDB IDs (1 IDs) : 3I5F&lt;/description&gt;
  
  &lt;structureIdList&gt;3I5F&lt;/structureIdList&gt;
  
  &lt;/orgPdbQuery&gt;
  </code></pre>
  
  <p>And this is my code for the request:</p>
  
  <pre><code>void WindowWrapper::postRequest()
  {
      QNetworkRequest request;
  
      QUrl res = QUrl(request_url_);
  
      QUrl query;
      query.addQueryItem("queryType","org.pdb.query.simple.StructureIdQuery");
      query.addQueryItem("structureIdList","3I5F");
  
      request.setHeader(QNetworkRequest::ContentTypeHeader, "application/octet-stream");
      request.setUrl(res);
  
      QObject::connect(network_, SIGNAL(finished(QNetworkReply*)),
                       this, SLOT(slotRequestFinished(QNetworkReply*)));
  
      network_-&gt;post(request, query.encodedQuery());
  }
  
  
  void WindowWrapper::slotRequestFinished(QNetworkReply* reply)
  {
      if(reply-&gt;error() &gt; 0)
      {
          qDebug() &lt;&lt; reply-&gt;errorString();
      }
      else
      {
          QByteArray data = reply-&gt;readAll();            
  
          qDebug() &lt;&lt; "Request successful!";
          qDebug() &lt;&lt; data;             
      }
  }
  </code></pre>
  
  <p>And the method call:</p>
  
  <pre><code>    wrapper_-&gt;set_request_url("http://www.rcsb.org/pdb/rest/search/");
      wrapper_-&gt;postRequest();
  </code></pre>
  
  <p>And on my debug output I get this:</p>
  
  <pre><code>Request successful! 
  "" 
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I also tried this for the request, but I still got no response:</p>
  
  <pre><code>void WindowWrapper::postRequest()
  {
      QNetworkRequest request;
  
      request.setRawHeader("Content-Type", "text/xml;charset=UTF-8");
      request.setUrl(QUrl(request_url_));
  
      QString query =
          "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;"
          "&lt;orgPdbQuery&gt;"
          "&lt;queryType&gt;org.pdb.query.simple.StructureIdQuery&lt;/queryType&gt;"
          "&lt;description&gt;Simple query for a list of PDB IDs (1 IDs) : 3I5F&lt;/description&gt;"
          "&lt;structureIdList&gt;3I5F&lt;/structureIdList&gt;"
          "&lt;/orgPdbQuery&gt;";
  
      QObject::connect(network_, SIGNAL(finished(QNetworkReply*)),
                   this, SLOT(slotRequestFinished(QNetworkReply*)));
  
      network_-&gt;post(request, query.toUtf8());
  </code></pre>
  
  <p>}</p>
  
  <p>Anyone knows what am I doing wrong? Please...</p>