2017 © Pedro Peláez
 

library curl

A lightweight CURL wrapper for php

image

flashytime/curl

A lightweight CURL wrapper for php

  • Tuesday, May 22, 2018
  • by flashytime
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Curl

A lightweight CURL wrapper for php, (*1)

Installation

composer require flashytime/curl

Usage

Instantiation
$curl = new \Flashytime\Curl\Curl();

or, (*2)

$curl = \Flashytime\Curl\Curl::init();
GET
$curl->url($url)->get();

or, (*3)

//$params is a query parameter array, like ['id' => 1, 'uid' => 2]
$curl->url($url, $params)->get();
POST
//$data is a multi array
$curl->url($url)->set($data)->post();
PUT
$curl->url($url)->set($data)->put();
PATCH
$curl->url($url)->set($data)->patch();
DELETE
$curl->url($url)->delete();
DOWNLOAD
$curl->url($url)->download($file);
Set Options
//$option is the CURLOPT_XXX option
$curl->setOption($option, $value)
->url($url)
->set($data)
->post();

or, (*4)

$curl->setOptions([$option1 => $value1, $option2 => $value2])
->url($url)
->set($data)
->post();
Result
if ($curl->error()) {
    var_dump($curl->message());
}
//the response data
$response = $curl->response();
$curl->close();

License

MIT, (*5)

The Versions

22/05 2018

dev-master

9999999-dev

A lightweight CURL wrapper for php

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-curl *

 

The Development Requires

by Avatar flashytime

22/05 2018

v1.0.0

1.0.0.0

A lightweight CURL wrapper for php

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-curl *

 

The Development Requires

by Avatar flashytime