Mantis - Quercus
Viewing Issue Advanced Details
4832 major always 10-29-11 17:46 06-21-12 13:58
jamesdlow  
nam  
normal  
closed 4.0.14  
fixed  
none    
none  
0004832: Curl ignores what is set in the "Content-Type" Header for a POST
This is because it is only gets it from PostBody in com.caucho.quercus.lib.curl.HttpPostRequest.java instead of from the curl object curl.getRequestPropertiesMap().get("Content-Type")

I have uploaded a working version that conditionally checks the curl object before it gets it from the PostBody.

In PHP it is ignoring this:
<?php
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, 'Content-Type: application/json');
?>
 HttpPostRequest.java [^] (3,437 bytes) 10-29-11 17:46

Notes
(0005925)
nam   
06-21-12 13:58   
php/5033

Fixed for 4.0.29. The following should work now:

  curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));