Exemple #1
0
 /**
  * Set message body
  *
  * @param  string  $body the new body of the message
  * @return boolean Returns TRUE on success or FALSE on failure.
  */
 public function setBody(Body $body)
 {
     parent::setBody($body);
     return $this->addHeaders(array('Content-Length' => (string) strlen($this->body)), true);
 }
Exemple #2
0
 /**
  * Sets POST fields
  *
  * @param array $fields
  */
 public function setPostFields(array $fields)
 {
     $this->post = $fields;
     $body = new Message\Body();
     $body->append(http_build_query($fields));
     parent::setBody($body);
     $_POST = $fields;
     $_REQUEST = array_merge($_GET, $_POST);
 }