1 | <?php |
||
2 | |||
3 | $curl = curl_init(); |
||
4 | |||
5 | curl_setopt_array($curl, array( |
||
6 | CURLOPT_URL => 'https://localhost/v1/restaurants/1', |
||
7 | CURLOPT_RETURNTRANSFER => true, |
||
8 | CURLOPT_ENCODING => '', |
||
9 | CURLOPT_MAXREDIRS => 10, |
||
10 | CURLOPT_TIMEOUT => 0, |
||
11 | CURLOPT_FOLLOWLOCATION => true, |
||
12 | CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
||
13 | CURLOPT_CUSTOMREQUEST => 'DELETE', |
||
14 | )); |
||
15 | |||
16 | $response = curl_exec($curl); |
||
17 | $err = curl_errno($curl); |
||
18 | $errmsg = curl_error($curl) ; |
||
19 | |||
20 | curl_close($curl); |
||
21 | |||
22 | echo (!empty($err)) ? $errmsg : $response; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
23 |