new

$client = new \GuzzleHttp\Client();
$response = $client->post(“https://api.vpnresellers.com/v3/accounts”, [
‘headers’ => [
“Authorization” => “Bearer {token}”,
“Accept” => “application/json”,
“Content-Type” => “application/json”,
],
‘json’ => [
“username” => “eius”,
“password” => “nemo”,
],
]);
$body = $response->getBody();
print_r(json_decode((string) $body));
{
“data”: {
“id”: 9,
“username”: “plmkojnhbgv”,
“status”: “Active”,
“updated”: “2017-03-28 17:44:21”,
“created”: “2017-03-24 19:26:24”
}
}
{
“message”: “Bad Request.”
}
{
“message”: “Unauthorized.”
}
{
“message”: “Insufficient Balance.”
}