WordPress\AiClient\Providers\Http\DTO

Response::toArraypublicWP 0.1.0

{@inheritDoc}

Method of the class: Response{}

No Hooks.

Returns

ResponseArrayShape.

Usage

$Response = new Response();
$Response->toArray(): array;

Changelog

Since 0.1.0 Introduced.

Response::toArray() code WP 7.0.4

public function toArray(): array
{
    $data = [self::KEY_STATUS_CODE => $this->statusCode, self::KEY_HEADERS => $this->headers->getAll()];
    if ($this->body !== null) {
        $data[self::KEY_BODY] = $this->body;
    }
    return $data;
}