public function body($data = null, $options = []) {
		$default = ['buffer' => null, 'encode' => false, 'decode' => false];
		$options += $default;

		if ($data !== null) {
			$this->body = array_merge((array) $this->body, (array) $data);
		}
		$body = $this->body;

		if (empty($options['buffer']) && $body === null) {
			return "";
		}
		if ($options['encode']) {
			$body = $this->_encode($body);
		}
		$body = is_string($body) ? $body : join("\r\n", (array) $body);

		if ($options['decode']) {
			$body = $this->_decode($body);
		}
		return ($options['buffer']) ? str_split($body, $options['buffer']) : $body;
	}
public function body($data = null, $options = []) {
		$default = ['buffer' => null, 'encode' => false, 'decode' => false];
		$options += $default;

		if ($data !== null) {
			$this->body = array_merge((array) $this->body, (array) $data);
		}
		$body = $this->body;

		if (empty($options['buffer']) && $body === null) {
			return "";
		}
		if ($options['encode']) {
			$body = $this->_encode($body);
		}
		$body = is_string($body) ? $body : join("\r\n", (array) $body);

		if ($options['decode']) {
			$body = $this->_decode($body);
		}
		return ($options['buffer']) ? str_split($body, $options['buffer']) : $body;
	}
public function body ( $ data = null , $ options = [ ] ) { $ default = [ 'buffer' => null , 'encode' => false , 'decode' => false ] ; $ options += $ default ; if ( $ data !== null ) { $ this -> body = array_merge ( ( array ) $ this -> body , ( array ) $ data ) ; } $ body = $ this -> body ; if ( empty ( $ options [ 'buffer' ] ) && $ body === null ) { return "" ; } if ( $ options [ 'encode' ] ) { $ body = $ this -> _encode ( $ body ) ; } $ body = is_string ( $ body ) ? $ body : join ( "\r\n" , ( array ) $ body ) ; if ( $ options [ 'decode' ] ) { $ body = $ this -> _decode ( $ body ) ; } return ( $ options [ 'buffer' ] ) ? str_split ( $ body , $ options [ 'buffer' ] ) : $ body ; }
Add data to and compile the HTTP message body, optionally encoding or decoding its parts
according to content type.

@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
Add data to and compile the HTTP message body optionally encoding or decoding its parts according to content type .