Skip to content

Instantly share code, notes, and snippets.

@Illizian
Created January 20, 2014 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Illizian/8521743 to your computer and use it in GitHub Desktop.
Save Illizian/8521743 to your computer and use it in GitHub Desktop.
<?php
// Create a plain request - Working
$request = Request::create('{API_ENDPOINT}', 'GET');
$response = Route::dispatch($request)->getContent();
// Create a request with secret in header
$request = Request::create('{API_ENDPOINT}', 'GET');
$headers = new Symfony\Component\HttpFoundation\HeaderBag(array('secret' => 'A_LONG_SECRET_KEY'));
$request->headers = $headers;
$response = Route::dispatch($request)->getContent();
// secret not sent to server :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment