body() public method

Add data to and compile the HTTP message body, optionally encoding or decoding its parts according to content type.
public body ( mixed $data = null, array $options = [] ) : array
$data mixed
$options array - `'buffer'` _integer_: split the body string - `'encode'` _boolean_: encode the body based on the content type - `'decode'` _boolean_: decode the body based on the content type
return array
Example #1
0
 /**
  * Compile the HTTP message body, optionally encoding its parts according to content type.
  *
  * @see lithium\net\http\Message::body()
  * @see lithium\net\http\Message::_encode()
  * @param mixed $data
  * @param array $options
  *        - `'buffer'` _integer_: split the body string
  *        - `'encode'` _boolean_: encode the body based on the content type
  *        - `'decode'` _boolean_: decode the body based on the content type
  * @return array
  */
 public function body($data = null, $options = array())
 {
     $defaults = array('encode' => true);
     return parent::body($data, $options + $defaults);
 }