2017 © Pedro Peláez
 

library curl

curl简单封装

image

panwenbin/curl

curl简单封装

  • Wednesday, July 11, 2018
  • by panwenbin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 100 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 14 % Grown

The README.md

curl

curl简单封装,暂时主要为了方便的GET/POST/PATCH/HEAD/OPTIONS/DELETE,代替file_get_contents, (*1)

简单使用示例

use panwenbin\helper\Curl;

$res = Curl::to('https://github.com/panwenbin')->withHeader('User-Agent', 'PHP CURL')->get();
$res = Curl::to('http://www.example.com/')->withData(['username' => 'panwenbin', 'password' => 'password'])->post();
$res = Curl::to('http://www.example.com/source/1')->withData(['minPriceYuan' => 123])->patch();
$res = Curl::to('http://www.example.com/')->withData(['product_id' => '123'])->get();
$res = Curl::to('http://www.example.com/profile')->withCookieFile('cookiejar.txt')->get();
$imageFile = new \CURLFile($filename);
$res = Curl::to($uploadUrl)->withData(['media' => $imageFile])->withOption(CURLOPT_TIMEOUT, 180)->post();
if ($res->code == 200) {
    $html = $res->body;
}

The Versions

11/07 2018

dev-master

9999999-dev

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

10/06 2018

0.2.0

0.2.0.0

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

26/01 2017

dev-analysis-qrYO29

dev-analysis-qrYO29

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

09/10 2016

0.1.3

0.1.3.0

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

05/09 2016

0.1.2

0.1.2.0

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

15/08 2016

0.1.1

0.1.1.0

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl

05/08 2016

0.1.0

0.1.0.0

curl简单封装

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-curl *

 

by Pan Wenbin

curl