我必须在CodeIgnitor平台中使用参数执行DELETE请求.首先,我尝试使用cURL,但我切换到了Guzzle.
控制台中的请求示例如下:
curl -X DELETE -d '{"username":"test"}' http://example.net/resource/id
Run Code Online (Sandbox Code Playgroud)
但是在Guzzle的文档中,他们像GET一样使用参数DELETE http://example.net/resource/id?username=test,我不想这样做.
我尝试过:
$client = new GuzzleHttp\Client();
$client->request('DELETE', $url, $data);
Run Code Online (Sandbox Code Playgroud)
但请求只是调用DELETE http://example.com/resource/id没有任何参数.