WP_REST_Request::set_body
Sets body content.
Method of the class: WP_REST_Request{}
No Hooks.
Returns
null. Nothing (null).
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. |
WP_REST_Request::set_body() WP REST Request::set body code WP 6.9.1
public function set_body( $data ) {
$this->body = $data;
// Enable lazy parsing.
$this->parsed_json = false;
$this->parsed_body = false;
$this->params['JSON'] = null;
}