jblond / phpcurl
A php curl client
1.1.1
2023-11-19 13:23 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
README
install
composer require jblond/phpcurl
example
<?php use jblond\phpcurl\Client; use jblond\phpcurl\Decoder; require './vendor/autoload.php'; $client = new Client(); $decoder = new Decoder(); $response = $client->get('http://localhost/test.json'); if( !is_array($response)){ $content = $decoder->jsonToArray($response); } else { $content = $response; } print_r($content); print_r( $client->post( 'http://localhost/post.php', json_encode(['lorem' => 'lol']) ) );