title: curl : submit form data using post method in c++
body: <p>I want to submit a simple form data from the c++ to the server using post method using libcurl. how to do that ??</p>
  
  <p>My data is follows:</p>
  
  <pre><code>Url : http://localhost/myproject/myadmin/oauth_authorize/index/
  </code></pre>
  
  <p>Post data are follows:</p>
  
  <pre><code>admin_parameters=form_key=slkjdkfjd&amp;login[username]=sdfd&amp;login[password]=ksjdkkfd&amp;oauth_token=kdsjkfjdkfjd
  </code></pre>
  
  <p>My CURL code:</p>
  
  <pre><code>        CURL *curl;
          CURLcode res;
  
          curl=curl_easy_init();
          if(curl)
          {
              curl_easy_setopt(curl,CURLOPT_URL,"http://localhost/myproject/myadmin/oauth_authorize/index/");
  
              curl_easy_setopt(curl,CURLOPT_POST,true);   
              curl_easy_setopt(curl,CURLOPT_POSTFIELDS,admin_parameters);
  
              res = curl_easy_perform(curl);
              if(res != CURLE_OK)
              {
                  strError.Format("Error: Magento Admin Login Fails.: %s", res);
              }
              curl_easy_cleanup(curl);
          }
  </code></pre>
  
  <p>How to submit this data and get response from the server. please help me out.
  Thank in advanced.</p>