web/lib/Zend/Service/Rackspace/Abstract.php
changeset 1230 68c69c656a2c
parent 808 6b6c2214f778
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Service
    16  * @package    Zend_Service
    17  * @subpackage Rackspace
    17  * @subpackage Rackspace
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  */
    20  */
    21 
    21 
    22 require_once 'Zend/Http/Client.php';
    22 require_once 'Zend/Http/Client.php';
    23 
    23 
   327      */
   327      */
   328     protected function httpCall($url,$method,$headers=array(),$data=array(),$body=null)
   328     protected function httpCall($url,$method,$headers=array(),$data=array(),$body=null)
   329     {
   329     {
   330         $client = $this->getHttpClient();
   330         $client = $this->getHttpClient();
   331         $client->resetParameters(true);
   331         $client->resetParameters(true);
       
   332         if ($method == 'PUT' && empty($body)) {
       
   333             // if left at NULL a PUT request will always have 
       
   334             // Content-Type: x-url-form-encoded, which breaks copyObject()
       
   335             $client->setEncType(''); 
       
   336         }
   332         if (empty($headers[self::AUTHUSER_HEADER])) {
   337         if (empty($headers[self::AUTHUSER_HEADER])) {
   333             $headers[self::AUTHTOKEN]= $this->getToken();
   338             $headers[self::AUTHTOKEN]= $this->getToken();
   334         } 
   339         } 
   335         $client->setMethod($method);
   340         $client->setMethod($method);
   336         if (empty($data['format'])) {
   341         if (empty($data['format'])) {