I want to do basic access authentication using Guzzle and I am very new to programming. I have no clue what to do. I tried to do this using curl but my environment requires
According to what @bourgeois247 said about base64 encoding, the following worked perfectly for me on Guzzle 6:
$client = new Client(); $credentials = base64_encode('username:password'); $response = $client->post('url', [ 'headers' => [ 'Authorization' => 'Basic ' . $credentials, ], ]);