_prepareBody() protected method

Prepare the request body (for POST and PUT requests)
protected _prepareBody ( ) : string
return string
コード例 #1
0
 /**
  * Adding custom functionality to decode data after
  * standard prepare functionality
  *
  * @return string
  */
 protected function _prepareBody()
 {
     $body = parent::_prepareBody();
     if (!$this->_urlEncodeBody && $body) {
         $body = urldecode($body);
         $this->setHeaders('Content-length', strlen($body));
     }
     return $body;
 }
コード例 #2
0
 /**
  * Prepare the request body (for POST and PUT requests)
  *
  * @return string
  * @throws Zend_Http_Client_Exception
  */
 protected function _prepareBody()
 {
     if ($this->_streamingRequest) {
         $this->setHeaders(self::CONTENT_LENGTH, $this->raw_post_data->getTotalSize());
         return $this->raw_post_data;
     } else {
         return parent::_prepareBody();
     }
 }