Tuesday 15 January 2013

php - Send DELETE request to the external API -



php - Send DELETE request to the external API -

i have send delete request external cache api. how can that? i've been thinking using file() function, like:

file('https://someurl.com/api?parameter1=foo&parameter2=bar');

but first of doesn't recognize type of response, , sec throws error:

failed open stream: http request failed! http/1.1 500 internal server error in...and seems convert ampersands & (at to the lowest degree that's xdebug shows).

how can solve this?

use curl that:

$ch = curl_init(); curl_setopt($ch, curlopt_url,$url); curl_setopt($ch, curlopt_customrequest, "delete"); $result = curl_exec($ch);

php symfony2

No comments:

Post a Comment