Recommend this page to a friend! |
Classes of Subin Siby | Lobby | includes/src/vendor/rmccue/requests/docs/usage-advanced.md | Download |
|
DownloadAdvanced UsageSession HandlingMaking multiple requests to the same site with similar options can be a pain, since you end up repeating yourself. The Session object can be used to set default parameters for these. Let's simulate communicating with GitHub.
You can use the
Secure Requests with SSLBy default, HTTPS requests will use the most secure options available:
Requests bundles certificates from the [Mozilla certificate authority list][], which is the same list of root certificates used in most browsers. If you're accessing sites with certificates from other CAs, or self-signed certificates, you can point Requests to a custom CA list in PEM form (the same format accepted by cURL and OpenSSL):
Alternatively, if you want to disable verification completely, this is possible
with Security NoteRequests supports SSL across both cURL and fsockopen in a transparent manner.
Unlike other PHP HTTP libraries, support for verifying the certificate name is
built-in; that is, a request for (Note that WordPress now also supports this verification, thanks to efforts by the Requests development team.) (See also the [related PHP][php-bug-47030] and [OpenSSL-related][php-bug-55820] bugs in PHP for more information on Subject Alternate Name field.) [Mozilla certificate authority list]: http://www.mozilla.org/projects/security/certs/ [php-bug-47030]: https://bugs.php.net/bug.php?id=47030 [php-bug-55820]:https://bugs.php.net/bug.php?id=55820 |