Download the PHP package nggit/php-simple-client without Composer
On this page you can find all versions of the php package nggit/php-simple-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nggit/php-simple-client
More information about nggit/php-simple-client
Files in nggit/php-simple-client
Package php-simple-client
Short Description A Simple and Fast HTTP Client
License MIT
Homepage https://github.com/nggit/php-simple-client
Informations about the package php-simple-client
PHP Simple Client
A Simple and Fast HTTP Client, designed to be out of the box. There is also a simpleclient written in Python.
Quick Start
There are two versions, using cURL or native PHP Stream.
1. cURL version
2. stream_socket_client version (fsockopen variant)
You can just use a stand-alone PHP file like that, or use a wrapper class. At first, install it via composer:
Then, you can do something like this:
Example
Simple GET
Custom Request Method (Optional)
The fastest method to get only header is to use HEAD request.
Setting Headers To Be Sent
Setting Headers must be done before calling request()
and send()
.
Common
Page Redirects
PHP Simple Client has its own mechanism for handling page redirects without relying on php.ini.
You can control max allowed redirection via $client->setMaxRedirs($number)
.
$number = 0 means don't allow redirects and -1 means unlimited redirects (default).
Cookies
No worries. Look at the example below to log in to Facebook.
Advanced
There are some hidden features to hack like getResponse()
to view history of redirection.