I'm working with a service that requires me to call it via:
curl -u username:password -X POST "http://www.theirurl.com"
I'd like to use Guzzle rather than do a raw CURL, however. Is there a way to have Guzzle pass the -u
parameter? I tried User-Agent, but that's not correct.
That's not a user agent, that's HTTP Basic Authentication.
$client->post('http://www.theirurl.com/', ['auth' => ['username', 'password']]);
http://guzzle.readthedocs.org/en/latest/request-options.html?highlight=auth#auth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With