openprovider / http
Openprovider Http Service
Installs: 7 362
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 21
Forks: 2
Open Issues: 0
Requires
- php: >=5.4.37
Requires (Dev)
- phpunit/phpunit: 4.*
Suggests
- ext-curl: Required for http connections
This package is not auto-updated.
Last update: 2024-11-06 14:13:23 UTC
README
A simple HTTP PHP library based on Curl, which helps to create HTTP request and get convenient response.
Current version
1.0.11
Examples
use \Openprovider\Service\Http\Request; use \Openprovider\Service\Http\Response; $response = Request::get('google.com')->execute(); $status = $response->getHttpStatusCode(); if ($response->isSuccess) { $cookie = $response->getCookie(); $header = $response->getHeader(); $data = $response->getData(); } else { print_r($response->getErrorCode() . ': ' . $response->getErrorDescription()); }
use \Openprovider\Service\Http\Request; use \Openprovider\Service\Http\Response; $request = new Request('website.com'); $response = $request->setFollowLocation(false) ->setMethod(Request::POST) ->setTimeout(10) ->setCookie('PREF=ID; Name=Noname') ->execute();
Authors
Contributors
All the contributors are welcome. If you would like to be the contributor please accept some rules.
- The pull requests will be accepted only in "develop" branch
- All modifications or additions should be tested
Thank you for your understanding!