Jul 1, 2016


HTTP client extension version 2.0.0 released

Yii team relased official HTTP client extension created mainly by Paul Klimov. The extension itself was ready for release long time ago but since there's PSR-7, there were debates about should it be released without it. Finally, it was decided that it's a good idea since, first of all, it's already adopted by many projects, and second, PSR-7 support could be added in further major versions.

Composing and performing HTTP requests looks like the following:

use yii\httpclient\Client;

$client = new Client();
$response = $client->createRequest()
    ->setData(['name' => 'John Doe', 'email' => 'johndoe@domain.com'])
if ($response->isOk) {
    $newUserId = $response->data['id'];

Comments (0)

No comments yet.

Signup in order to comment.