Skip to content

Commit

Permalink
Added example on how to use Cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
catharsisjelly committed Aug 18, 2014
1 parent b398534 commit dc838a8
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/get', array('Cookie' => $c->formatForHeader()));

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

0 comments on commit dc838a8

Please sign in to comment.