之前开发手写了curl的方法,支持get和post请求
现在要用 put 和 delete 方法,我想找一个专门负责请求的类库,不知有没有?最好能 composer 安装,谢谢
之前开发手写了curl的方法,支持get和post请求
现在要用 put 和 delete 方法,我想找一个专门负责请求的类库,不知有没有?最好能 composer 安装,谢谢
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');
?>
1 回答4.1k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
2 回答2.3k 阅读✓ 已解决
1 回答1.4k 阅读✓ 已解决
2 回答2.2k 阅读
1 回答669 阅读✓ 已解决
803 阅读
https://packagist.org/package... 这个