use \GuzzleHttp\Client;
$ip = '80.0.0.1';
$client = new Client([
'base_url' => ['https://restapi.com/{version}/', ['version' => 'v5.4']],
'defaults' => [
'headers' => [
'Accept' => 'application/json'
],
]
]);
$auth = $client->post('auth', [
'body' => [
'username' => 'username',
'password' => 'password']
])->json();