php-mod / Curl
Licence: mit
Curl
Stars: ✭ 284
Labels
Projects that are alternatives of or similar to Curl
php curl
Curl is an open source file transfer tool that uses URL syntax to work on the command line, where the basic functions of curl are encapsulated, such as COOKIES / encrypted transport / HTTP authentication / analog forms / upload files, etc.
Stars: ✭ 38 (-86.62%)
Mutual labels: curl
diciotto
✈️ A no-nonsense PHP Http client focused on DX (PSR 18 compliant)
Stars: ✭ 23 (-91.9%)
Mutual labels: curl
Graphqurl
curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.
Stars: ✭ 3,012 (+960.56%)
Mutual labels: curl
MultiHttp
This is a high performance , very useful multi-curl tool written in php. 一个超级好用的并发CURL工具!!!(httpful,restful, concurrency)
Stars: ✭ 79 (-72.18%)
Mutual labels: curl
FritzBoxShell
Some shell scripts for controlling and checking the Fritz!Box/Fritz!Repeater
Stars: ✭ 80 (-71.83%)
Mutual labels: curl
nycurl
A web server that fetches data from the New York Times and formats it for display in the terminal.
Stars: ✭ 27 (-90.49%)
Mutual labels: curl
Cake.Curl
🍰↕️ A cross-platform add-in for Cake that allows to transfer files to and from remote URLs using curl.
Stars: ✭ 17 (-94.01%)
Mutual labels: curl
crsync
A library and CLI tool of Client-side rsync over HTTP via curl, implemented by pure C.
Stars: ✭ 21 (-92.61%)
Mutual labels: curl
request-extra
⚡️ Extremely stable HTTP request module built on top of libcurl with retries, timeouts and callback API
Stars: ✭ 14 (-95.07%)
Mutual labels: curl
dePAC
seamless Proxy Auto-Config (a.k.a. Web Proxy Auto Discovery) for CLI apps
Stars: ✭ 26 (-90.85%)
Mutual labels: curl
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+922.18%)
Mutual labels: curl
HttpRequest
Simplified HTTP client, A simplie golang HTTP client library.
Stars: ✭ 134 (-52.82%)
Mutual labels: curl
yab
Call and benchmark YARPC services from the command line.
Stars: ✭ 66 (-76.76%)
Mutual labels: curl
Requester
Powerful, modern HTTP/REST client built on top of the Requests library
Stars: ✭ 273 (-3.87%)
Mutual labels: curl
Curl Cheat Sheet
A single page document with the most important curl options for HTTP explained
Stars: ✭ 262 (-7.75%)
Mutual labels: curl
Auto LFI
A simple Script which tests for LFI (Local File Inclusion) via Curl
Stars: ✭ 17 (-94.01%)
Mutual labels: curl
PHP Curl Class
This library provides an object-oriented wrapper of the PHP cURL extension.
If you have questions or problems with installation or usage create an Issue.
Installation
In order to install this library via composer run the following command in the console:
composer require curl/curl
or add the package manually to your composer.json file in the require section:
"curl/curl": "^2.0"
Usage examples
$curl = new Curl\Curl();
$curl->get('http://www.example.com/');
$curl = new Curl\Curl();
$curl->get('http://www.example.com/search', array(
'q' => 'keyword',
));
$curl = new Curl\Curl();
$curl->post('http://www.example.com/login/', array(
'username' => 'myusername',
'password' => 'mypassword',
));
$curl = new Curl\Curl();
$curl->setBasicAuthentication('username', 'password');
$curl->setUserAgent('');
$curl->setReferrer('');
$curl->setHeader('X-Requested-With', 'XMLHttpRequest');
$curl->setCookie('key', 'value');
$curl->get('http://www.example.com/');
if ($curl->error) {
echo $curl->error_code;
}
else {
echo $curl->response;
}
var_dump($curl->request_headers);
var_dump($curl->response_headers);
$curl = new Curl\Curl();
$curl->setOpt(CURLOPT_RETURNTRANSFER, TRUE);
$curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
$curl->get('https://encrypted.example.com/');
$curl = new Curl\Curl();
$curl->put('http://api.example.com/user/', array(
'first_name' => 'Zach',
'last_name' => 'Borboa',
));
$curl = new Curl\Curl();
$curl->patch('http://api.example.com/profile/', array(
'image' => '@path/to/file.jpg',
));
$curl = new Curl\Curl();
$curl->delete('http://api.example.com/user/', array(
'id' => '1234',
));
$curl->close();
// Example access to curl object.
curl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
curl_close($curl->curl);
// Example of downloading a file or any other content
$curl = new Curl\Curl();
// open the file where the request response should be written
$file_handle = fopen($target_file, 'w+');
// pass it to the curl resource
$curl->setOpt(CURLOPT_FILE, $file_handle);
// do any type of request
$curl->get('https://github.com');
// disable writing to file
$curl->setOpt(CURLOPT_FILE, null);
// close the file for writing
fclose($file_handle);
Testing
In order to test the library:
- Create a fork
- Clone the fork to your machine
- Install the depencies
composer install
- Build and start the docker image (in
tests/server
)docker build . -t curlserver
startdocker run -p 1234:80 curlserver
- Run the unit tests
./vendor/bin/phpunit tests
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].