PUT method using drupal_http_request I need to update data in HP Quality Center with Drupal.

After login with success, I get some data from QC with the following code (simplified):

$headers = array('Cookie' =&gt; $cookie);
$request = drupal_http_request('http://qc.intra.xxx.com:8090/qcbin/rest/domains/' . $domainname . '/projects/' . $projectname . '/test-instances?query={cycle-id["' . $id . '"]}', 
    array('headers' =&gt; $headers), 
    'GET'
);
$xml = simplexml_load_string($request-&gt;data);
$json = json_encode($xml);
$testset_array = json_decode($json, TRUE);


What I want now is to update some QC fields. For that, instead of GET, I need PUT. The code I've tried to update a test instance:

    $xml_data = '&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
            &lt;Entity Type="test-instance"&gt;
                &lt;Fields&gt;
                    &lt;Field Name="my_field"&gt;
                        &lt;Value&gt;my value&lt;/Value&gt;
                    &lt;/Field&gt;
                &lt;/Fields&gt;
            &lt;/Entity&gt;';

    $headers = array('Cookie' =&gt; $cookie, 'content-type' =&gt; 'application/xml');

    $url = 'http://qc.intra.xxx.com:8090/qcbin/rest/domains/' . $domainname . '/projects/' . $projectname . '/test-instances/404886';
    $request = drupal_http_request($url, 
       array('headers' =&gt; $headers), 
       'PUT', 
       $data
    );

    $xml = simplexml_load_string($request-&gt;data);
    $json = json_encode($xml);
    $testset_array = json_decode($json, TRUE);


This is not working and I don't get any error also, what am I doing wrong?

Thanks
For starters, looking at your code, $xml_data is instantiated but never used in your call to drupal_http_request(), you use the $data variable instead. Intentional or the culprit?

Second, your call to drupal_http_request follows the Drupal 6 (and earlier) syntax, what system are you using?

For Drupal 7, it should look like this:

$response = drupal_http_request($url, 
  array(
    'headers' =&gt; $headers,
    'method' =&gt; 'PUT', 
    'data' =&gt; $xml_data,
  )
);

// this should reveal what was actually sent out
dsm($response-&gt;request);


Hope this helps some!