cube-group/myaf-net

v0.0.4 2018-06-05 07:12 UTC

This package is not auto-updated.

Last update: 2024-11-08 13:05:30 UTC


README

Latest Stable Version Total Downloads License

常用属性

  • 请求尝试的次数: $curl->try
  • 请求尝试的最大次数: $curl->tryMax
  • 请求耗时(单位:毫秒): $curl->useTime

常规用法

$curl = new LCurl();
$curl->post('http://google.com',['a'=>'1'],['X-Token'=>'test'],15);
$curl->post('http://google.com','<xml><item><a>1</a></item></xml>');
$curl->get('http://google.com');
$curl->get('http://google.com',['a'=>'1']);

设定尝试次数

$curl = new LCurl(['tryMax'=>3]);
$curl->post('http://google.com',['a'=>'1'],['X-Token'=>'test'],15);
echo 'try: '.$curl->try;

钉钉机器人

$ding = new LDing('钉钉群报警机器人地址');
$ding->send('发什么都可以');