rmccue/requests
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The rmccue/requests is a robust HTTP library implemented in PHP designed for user-friendliness. It's inspired by the API of the popular Requests Python library and is ideal for developers looking to leverage tools for sending HTTP requests. This library comes with a plethora of advantageous features such as support for international domains and URLs, browser-style SSL verification, connection timeouts, and automatic decompression.
To use the rmccue/requests library, you first have to install it through composer, GitHub source, or by fetching a zip/tarball from GitHub. Here's the composer installation command:
composer require rmccue/requests
After installation, you can start using the library in your scripts, as illustrated in the example below:
$headers = array('Accept' => 'application/json');
$options = array('auth' => array('user', 'pass'));
$request = WpOrg\Requests\Requests::get('https://api.github.com/gists', $headers, $options);
var_dump($request->status_code);
// int(200)
var_dump($request->headers['content-type']);
// string(31) "application/json; charset=utf-8"
var_dump($request->body);
// string(26891) "[...]"
This code makes a GET request to a specified URL, with headers and options defined in arrays. The status code, headers, and body data from the response can then be accessed easily.
Looking for comprehensive documentation for the rmccue/requests library? You can find it on the official GitHub repository.
Start with the prose-based documentation that guides you on how to use Requests. For in-depth insights, check out the documentation for \WpOrg\Requests\Requests::request()
where all the parameters are extensively explained. Moreover, Requests is fully documented with PHPDoc. In case of any issues, you can raise it on their GitHub issue page.