dev-master 2017-01-27 15:00 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:56:04 UTC


README

enter image description here

此库提供了 PHP cURL 扩展的对象封装。

如果您在安装或使用过程中有任何问题或疑问,请创建一个问题

安装

要通过 composer 安装此库,请在控制台运行以下命令

composer require assistant/curl

使用示例

$curl=new Assistant\Curl();
$curl->get('https://httpbin.org/get');
$curl=new Assistant\Curl();
$curl->get('https://httpbin.org/get','first_name=Semih&last_name=Aydemir');
$curl=new Assistant\Curl();
$curl->post('https://httpbin.org/post');
$curl=new Assistant\Curl();
$curl->post('https://httpbin.org/post','first_name=Semih&last_name=Aydemir');
$curl=new Assistant\Curl();
$curl->request('get','https://httpbin.org/post','first_name=Semih&last_name=Aydemir');
$curl=new Assistant\Curl();
$curl->request('post','https://httpbin.org/post','first_name=Semih&last_name=Aydemir');

可用方法

  • $curl->setLink();
  • $curl->getLink();
  • $curl->setHeader();
  • $curl->getHeader();
  • $curl->setHeaders();
  • $curl->getHeaders();
  • $curl->setUserAgent();
  • $curl->getUserAgent();
  • $curl->setProxy();
  • $curl->getProxy();
  • $curl->setFollowLocation();
  • $curl->getFollowLocation();
  • $curl->setAutoReferer();
  • $curl->getAutoReferer();
  • $curl->setTimeOut();
  • $curl->getTimeOut();
  • $curl->setParams();
  • $curl->getParams();
  • $curl->getResponse();
  • $curl->getErrorMessage();
  • $curl->getErrorNo();
  • $curl->getInfo();
  • $curl->isSuccess();
  • $curl->curl2string();
  • $curl->log();
  • $curl->get();
  • $curl->post();
  • $curl->request();