O2CURL
, (*1)
O2CURL is an Open Source PHP Lightweight HTTP Request Client Libraries.
O2CURL is build for working more powerfull with O2System Framework, but also can be used for integrated with others as standalone version with limited features.
O2CURL is insipired by [Unirest][10], so O2CURL is has also functionality similar with it, but a little bit different at the syntax., (*2)
Another amazing product from , released under MIT License., (*3)
Features
- Utility methods to call GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH requests
- Supports form parameters, file uploads and custom body entities
- Supports gzip
- Supports Basic, Digest, Negotiate, NTLM Authentication natively
- Customizable timeout
- Customizable default headers for every request (DRY)
- Automatic JSON parsing into a native object for JSON responses
Installation
The best way to install O2CURL is to use Composer, (*4)
composer require o2system/o2curl:"dev-master"
Usage
use O2System\CURL;
$curl = new CURL;
/*
* Post Request
*
* @param string $url Request URL
* @param string $path Request URI Path Segment
* @param array $params Request Parameters
* @param array $headers Request Headers
*
* @return \O2System\CURL\Factory\Request
*/
$response = $curl->post(
"http://domain.com/", // URL
'request/json', // Path URI Segment
// Parameters
array(
"foo" => "hello",
"bar" => "world"
),
// Headers
array(
"Accept" => "application/json"
)
);
$response->meta; // HTTP Request Metadata
$response->header; // Parsed header
$response->body; // Parsed body
$response->raw_body; // Unparsed body
More details at the Wiki., (*5)
Ideas and Suggestions
Please kindly mail us at developer@o2system.in., (*6)
Bugs and Issues
Please kindly submit your issues at Github so we can track all the issues along development., (*7)
System Requirements
Credits