Skip to content

Commit

Permalink
Merge pull request #124 from catharsisjelly/master
Browse files Browse the repository at this point in the history
Added example on how to use Cookie
  • Loading branch information
rmccue committed Apr 27, 2015
2 parents 9822168 + 819c545 commit aa2168e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/cookie.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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('login_uid', 'something');

// Now let's make a request!
$request = Requests::get('http://httpbin.org/cookies', array('Cookie' => $c->formatForHeader()));

// Check what we received
var_dump($request);

0 comments on commit aa2168e

Please sign in to comment.