I am developing an API using resource controller in laravel. To call this api from my client i am using guzzle(my client is also laravel). For POST and GET requests it worked fine but for delete request it is showing below error.
My delete request is
$client = new Client();
$res = $client->delete('http://localhost:8017/opendemo_old/public/TestAPI/123456');
Below are my post and get request which are working fine.
$client = new Client();
$res = $client->request('POST', 'http://localhost:8017/opendemo_old/public/TestAPI', [
'form_params' => [
'field_name' => 'abcddd',
'other_field' => '12344',
'nested_field' => [
'nested' => 'hello'
]
]
]);
$client = new Client();
$res = $client->request('GET', 'http://localhost:8017/opendemo_old/public/TestAPI/123'); <br/>
I am not getting what's the problem with delete request. I am using guzzle 6 and laravel 5.2(client & server).
public function destroy($id) { // echo "Delete"; }
– prudhvi259