mrjnamei / curl
A http(s) client of php
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/mrjnamei/curl
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-10-04 01:00:48 UTC
README
- Usage
$options = [] ;
$http = new mrjnamei\Curl($options);
// http get
$url = "http://www.google.com";
$res = $http->get($url,["name" => "jack"]); // $res is the response
$res = $http->post($url,["name" => "jack"]); // post request
- construct options
$options = [
'base_path' => 'http://www.google.com/' , //base path
'headers' => [
'Content-Type' => 'text/html;charset=utf-8',
],
'CURLOPT_CONNECTTIMEOUT' => 30 , //timeout
'CURLOPT_SSL_VERIFYPEER' => true , // use ssl
'CURLOPT_CAINFO' => 'path/to/cert.pem',
........
];