Add additional examples to cover supported request methods

This commit is contained in:
Zach Borboa
2016-10-12 08:06:15 -07:00
parent fada23bbba
commit 27abd4899a
8 changed files with 125 additions and 14 deletions
+9 -4
View File
@@ -3,13 +3,18 @@ require __DIR__ . '/vendor/autoload.php';
use \Curl\Curl;
// curl -X PUT -d "id=1&first_name=Zach&last_name=Borboa" "https://httpbin.org/put"
// curl --request PUT "https://httpbin.org/put" --data "id=1&first_name=Zach&last_name=Borboa"
$curl = new Curl();
$curl->put('https://httpbin.org/put', array(
'id' => 1,
'id' => '1',
'first_name' => 'Zach',
'last_name' => 'Borboa',
));
echo 'Data server received via PUT:' . "\n";
var_dump($curl->response->form);
if ($curl->error) {
echo 'Error: ' . $curl->errorCode . ': ' . $curl->errorMessage;
} else {
echo 'Data server received via PUT:' . "\n";
var_dump($curl->response->form);
}