Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.    $dataString = json_encode($data);
  2.  
  3.         $ch = curl_init($this->apiUrl . $url);
  4.         curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $type);
  5.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  6.         curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);
  7.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8.         curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  9.                 'Content-Type: application/json',
  10.                 'Expect:',
  11.                 'Content-Length: ' . strlen($dataString))
  12.         );
  13.         $result = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement