thoulah/yii2-httpclient

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Yii 2 HTTP client

Installs: 39

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Type:yii2-extension

1.0.0 2020-05-24 19:23 UTC

This package is auto-updated.

Last update: 2021-11-24 23:45:47 UTC


README

This extension extends the yii2-httpclient extension to add some basic functionality.

Packagist Version PHP from Packagist Packagist GitHub

Installation

The preferred way to install this extension is through composer.

Either run

composer require thoulah/yii2-httpclient

or add

"thoulah/yii2-httpclient": "^1.0"

to the require section of your composer.json file.

Usage

$client = new \thoulah\httpclient\Client('https://www.google.com/');
$response = $client->getUrl('');
$site = $response->content;
$client = new \thoulah\httpclient\Client('https://www.google.com/');
$response = $client->getFile('robots.txt');
$file = $response->data;
$client = new \thoulah\httpclient\Client('https://www.google.com/');
$response = $client->saveFile('robots.txt', /tmp/googleRobots.txt);

Code Climate maintainability Codacy branch grade Scrutinizer code quality (GitHub/Bitbucket) Travis (.com) branch