mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-02-01 09:39:58 +09:00
Initial import of composer dependencies (--no-dev)
This commit is contained in:
parent
71fc952126
commit
546606b208
696 changed files with 54815 additions and 44 deletions
31
vendor/rmccue/requests/docs/authentication.md
vendored
Executable file
31
vendor/rmccue/requests/docs/authentication.md
vendored
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
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);
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue