WP_REST_Request::set_body() public WP 4.4.0
Sets body content.
{} It's a method of the class: WP_REST_Request{}
No Hooks.
Return
Null. Nothing.
Usage
$WP_REST_Request = new WP_REST_Request(); $WP_REST_Request->set_body( $data );
- $data(string) (required)
- Binary data from the request body.
Changelog
Since 4.4.0 | Introduced. |
Code of WP_REST_Request::set_body() WP REST Request::set body WP 5.6
public function set_body( $data ) {
$this->body = $data;
// Enable lazy parsing.
$this->parsed_json = false;
$this->parsed_body = false;
$this->params['JSON'] = null;
}