WagnerMontanini /
goomerapi
| 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 => 'PUT', |
||
| 14 | CURLOPT_POSTFIELDS => 'name=Goomer&address=Rua%20Sorocaba%2C%20000%2C%20Sorocaba%2CS%C3%A3o%20Paulo&image=imagem%2Fimg.jpg&is_active=1&is_accepted=0&is_schedulable=1&schedule_data=%7B%22wednesday%22%3A%5B%7B%22open%22%20%3A%2219%3A00%22%2C%22close%22%20%3A%2223%3A59%22%7D%5D%7D', |
||
| 15 | )); |
||
| 16 | |||
| 17 | $response = curl_exec($curl); |
||
| 18 | $err = curl_errno($curl); |
||
| 19 | $errmsg = curl_error($curl) ; |
||
| 20 | |||
| 21 | curl_close($curl); |
||
| 22 | |||
| 23 | echo (!empty($err)) ? $errmsg : $response; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 24 |