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 一直在用這個,還不錯。