PHP Classes

File: includes/src/vendor/rmccue/requests/examples/cookie.php

Recommend this page to a friend!
  Classes of Subin Siby   Lobby   includes/src/vendor/rmccue/requests/examples/cookie.php   Download  
File: includes/src/vendor/rmccue/requests/examples/cookie.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Lobby
Web OS to install and run Web applications
Author: By
Last change:
Date: 7 years ago
Size: 424 bytes
 

Contents

Class file image Download
<?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);