0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.117.101.250


Current Path : /var/www/student/gfgcg/razorpay/razorpay-php/libs/Requests-1.6.1/docs/
Upload File :
Current File : /var/www/student/gfgcg/razorpay/razorpay-php/libs/Requests-1.6.1/docs/authentication.md

Authentication
==============
Many requests that you make will require authentication of some type. Requests
includes support out of the box for HTTP Basic authentication, with more
built-ins coming soon.

Making a Basic authenticated call is ridiculously easy:

```php
$options = array(
	'auth' => new Requests_Auth_Basic(array('user', 'password'))
);
Requests::get('http://httpbin.org/basic-auth/user/password', array(), $options);
```

As Basic authentication is usually what you want when you specify a username
and password, you can also just pass in an array as a shorthand:

```php
$options = array(
	'auth' => array('user', 'password')
);
Requests::get('http://httpbin.org/basic-auth/user/password', array(), $options);
```

Note that POST/PUT can also take a data parameter, so you also need that
before `$options`:

```php
Requests::get('http://httpbin.org/basic-auth/user/password', array(), null, $options);
```