Created
October 21, 2015 20:59
-
-
Save mikedfunk/af06f41f3e9e2ed965fc to your computer and use it in GitHub Desktop.
How to use GuzzleHTTP 6.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in a method... | |
$this->client = new GuzzleHttp\Client(['base_uri' => 'my_base_uri']); | |
$config = [ | |
'auth' => [$this->username, $this->password], | |
'headers' => [ | |
'x-app-id' => $this->appId, | |
], | |
'json' => [ | |
// boomtrain's id. If left blank it will search by email then | |
// app_member_id | |
'bsin' => '', | |
'email' => $userData['email'], | |
'app_member_id' => $userData['id'], | |
'firstName' => $userData['first_name'], | |
'lastName' => $userData['last_name'], | |
'attributes' => $this->getAttributes($userData), | |
], | |
]; | |
return $this->client->put('persons', $config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment