Advertisement
Guest User

Jason Post

a guest
May 30th, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. $data_string = json_encode($data);
  2. $ch=curl_init($url);
  3.  
  4. curl_setopt_array($ch, array(
  5. CURLOPT_POST => true,
  6. CURLOPT_POSTFIELDS => $data_string,
  7. CURLOPT_HEADER => true,
  8. CURLOPT_HTTPHEADER => array('Content-Type:application/json', 'Content-Length: ' . strlen($data_string)))
  9. ));
  10.  
  11. $result = curl_exec($ch);
  12. curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement