84669 人学习
152542 人学习
20005 人学习
5487 人学习
7821 人学习
359900 人学习
3350 人学习
180660 人学习
48569 人学习
18603 人学习
40936 人学习
1549 人学习
1183 人学习
32909 人学习
之前开发手写了curl的方法,支持get和post请求
现在要用 put 和 delete 方法,我想找一个专门负责请求的类库,不知有没有?最好能 composer 安装,谢谢
ringa_lee
https://packagist.org/package... 这个
guzzle,requests比较常用
A proper REST client for php 一直在用这个,还不错。
<?php $pest = new Pest('http://example.com'); $thing = $pest->get('/things'); $thing = $pest->post('/things', array( 'name' => "Foo", 'colour' => "Red" ) ); $thing = $pest->put('/things/15', array( 'colour' => "Blue" ) ); $pest->delete('/things/15'); ?>
https://packagist.org/package... 这个
guzzle,requests比较常用
A proper REST client for php 一直在用这个,还不错。