Skip to content

Instantly share code, notes, and snippets.

@weaverryan weaverryan/testing.php Secret
Last active Oct 9, 2015

What would you like to do?
Guzzle update
require __DIR__.'/vendor/autoload.php';
use GuzzleHttp\Client;
// create our http client (Guzzle)
$client = new Client(array(
'base_uri' => 'http://localhost:8000',
'http_errors' => false,
$nickname = 'ObjectOrienter'.rand(0, 999);
$data = array(
'nickname' => $nickname,
'avatarNumber' => 5,
'tagLine' => 'a test dev!'
$response = $client->post('/api/programmers', array(
'body' => json_encode($data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.