/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $url = 'https://www.google.com'; $method = 'POST'; # headers and data (this is API dependent, some uses XML) 'Accept: application/json', 'Content-Type: application/json', ); 'firstName'=> 'John', 'lastName'=> 'Doe' )); switch($method) { case 'GET': break; case 'POST': break; case 'PUT': break; case 'DELETE': break; }
URL: http://singletonio.blogspot.com/2009/07/simple-php-rest-client-using-curl.html