I previously developed a handwritten curl method that supports get and post requests
Now I need to use the put and delete methods. I want to find a class library that is specifically responsible for requests. Is there one? It is best to install it through composer, thank you
typecho2017-06-10 09:49:29
A proper REST client for php I have been using this and it is pretty good.
<?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');
?>