cookie.php 424 B

12345678910111213141516
  1. <?php
  2. // First, include Requests
  3. include('../library/Requests.php');
  4. // Next, make sure Requests can load internal classes
  5. Requests::register_autoloader();
  6. // Say you need to fake a login cookie
  7. $c = new Requests_Cookie('login_uid', 'something');
  8. // Now let's make a request!
  9. $request = Requests::get('http://httpbin.org/cookies', array('Cookie' => $c->formatForHeader()));
  10. // Check what we received
  11. var_dump($request);