OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
assets
/
payment
/
vendor
/
rmccue
/
requests
/
docs
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:24:36 AM
rwxr-xr-x
📄
README.md
974 bytes
03/26/2025 04:23:17 AM
rw-r--r--
📄
authentication-custom.md
1.5 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
authentication.md
1.14 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
goals.md
1.19 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
hooks.md
5.63 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
proxy.md
731 bytes
03/26/2025 04:23:17 AM
rw-r--r--
📄
upgrading.md
6.81 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
usage-advanced.md
4.17 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
usage.md
4.04 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
why-requests.md
7.23 KB
03/26/2025 04:23:17 AM
rw-r--r--
Editing: authentication.md
Close
Authenticating your request =========================== 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. A Basic authenticated call can be made like this: ```php $options = array( 'auth' => new WpOrg\Requests\Auth\Basic(array('user', 'password')) ); WpOrg\Requests\Requests::get('https://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') ); WpOrg\Requests\Requests::get('https://httpbin.org/basic-auth/user/password', array(), $options); ``` Note that `POST`/`PUT` requests take a `$data` parameter, so you need to pass that before `$options`: ```php WpOrg\Requests\Requests::post('https://httpbin.org/basic-auth/user/password', array(), null, $options); ``` *** Previous: [Advanced usage](usage-advanced.md) Next: [Custom authentification](authentication-custom.md)