Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Requests Laravel Package

rmccue/requests

Requests is a human-friendly PHP HTTP client for sending GET/POST/PUT/DELETE/PATCH/HEAD requests with headers, auth, files, and parameters. Supports cURL or fsockopen, SSL verification, decompression, and IDN URLs with a consistent API.

View on GitHub
Deep Wiki
Context7

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:

$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:

$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:

\WpOrg\Requests\Requests::post('https://httpbin.org/basic-auth/user/password', array(), null, $options);

Previous: Advanced usage

Next: Custom authentification

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle