Curl content_type always the default php
<pre><code>$file = file_get_contents($path, true);
$url = "https://secure.efaxdeveloper.com/EFax_WebFax.serv";

//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/x-www-form-urlencoded',
));
// Following line is compulsary to add as it is:
$data = 'id=' . urlencode("2313125942") . '&amp;name2=' . urlencode($file);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
$data = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
print_r('&lt;pre&gt;');
   print_r($info);
print_r('&lt;/pre&gt;');
</code></pre>

<p>In my code above I set the <code>Content-Type: application/x-www-form-urlencoded</code> and post data </p>

<pre><code>$data = 'id=' . urlencode("2313125942") . '&amp;name2=' . urlencode($file);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
</code></pre>

<p>But the result of the curl_getinfo()</p>

<pre><code>Array
(
    [url] =&gt; https://secure.efaxdeveloper.com/EFax_WebFax.serv
    [content_type] =&gt; text/html;charset=ISO-8859-1
    [http_code] =&gt; 200
    [header_size] =&gt; 226
    [request_size] =&gt; 175
    [filetime] =&gt; -1
    [ssl_verify_result] =&gt; 0
    [redirect_count] =&gt; 0
    [total_time] =&gt; 0.65944
    [namelookup_time] =&gt; 0.150319
    [connect_time] =&gt; 0.183032
    [pretransfer_time] =&gt; 0.261438
    [size_upload] =&gt; 531848
    [size_download] =&gt; 833
    [speed_download] =&gt; 1263
    [speed_upload] =&gt; 806514
    [download_content_length] =&gt; 833
    [upload_content_length] =&gt; 531848
    [starttransfer_time] =&gt; 0.293966
    [redirect_time] =&gt; 0
    [redirect_url] =&gt; 
    [primary_ip] =&gt; 104.12.131.61
    [certinfo] =&gt; Array
        (
        )

    [primary_port] =&gt; 443
    [local_ip] =&gt; 127.31.12.152
    [local_port] =&gt; 52972
)
</code></pre>

<p>My question is why content_type is [content_type] => text/html;charset=ISO-8859-1 and i can't see the post data. I'am a beginner in curl can anyone explain what is wrong in my code?</p>