Guest User

Untitled

a guest
Sep 20th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6. CURLOPT_URL => "http://example.com/rest/V1/orders/1/cancel",
  7. CURLOPT_RETURNTRANSFER => true,
  8. CURLOPT_ENCODING => "",
  9. CURLOPT_MAXREDIRS => 10,
  10. CURLOPT_TIMEOUT => 30,
  11. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  12. CURLOPT_CUSTOMREQUEST => "GET",
  13. CURLOPT_HTTPHEADER => array(
  14. "authorization: Bearer qctyw0k8uc7svw6m7hwwl58ws3twymts",
  15. "cache-control: no-cache",
  16. "content-type: application/json",
  17. ),
  18. ));
  19.  
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22.  
  23. curl_close($curl);
  24.  
  25. if ($err) {
  26. echo "cURL Error #:" . $err;
  27. } else {
  28. echo $response;
  29. }
Add Comment
Please, Sign In to add comment