Prepares request body for WordPress HTTP API.
Parameters
$requestWordPressAiClientDependenciesPsrHttpMessageRequestInterfacerequired- The PSR-7 request.
Source
private function prepare_body( RequestInterface $request ): ?string {
$body = $request->getBody();
if ( $body->getSize() === 0 ) {
return null;
}
if ( $body->isSeekable() ) {
$body->rewind();
}
return (string) $body;
}
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.