Response::toArray(): WordPressAiClientProvidersHttpDTOResponseArrayShape

In this article

{@inheritDoc}

Return

WordPressAiClientProvidersHttpDTOResponseArrayShape

Source

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;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.