-
Notifications
You must be signed in to change notification settings - Fork 498
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
819c545
commit 88a4cad
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
// First, include Requests | ||
include('../library/Requests.php'); | ||
|
||
// Next, make sure Requests can load internal classes | ||
Requests::register_autoloader(); | ||
|
||
// Say you need to fake a login cookie | ||
$c = new Requests_Cookie_Jar(['login_uid' => 'something']); | ||
|
||
// Now let's make a request! | ||
$request = Requests::get( | ||
'http://httpbin.org/cookies', //url | ||
[], // No need to set the headers the Jar does this for us | ||
['cookies' => $c] // Pass in the Jar as an option | ||
); | ||
|
||
// Check what we received | ||
var_dump($request); |