When I do this on the commandline:
curl -X POST -d '{"userDetails":{"username":"myself","password":"Myself123"}}' https://sub.domain.com/energy/api/login
it returns a sessionid like expected.
When I use Guzzle 6 on Laravel 5.5 and do this:
$client = new GuzzleHttp\Client();
$login = $client->post('https://sub.domain.com/energy/api/login', [
'userDetails' => [
'username' => 'myself',
'password' => 'Myself123'
]
]);
I get this error:
Server error: `POST https://sub.domain.com/energy/api/login` resulted in a `503 Service Unavailable` response: org.json.JSONException: JSONObject["userDetails"] not found.
What am I doing wrong?