This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Handle CORS */ | |
// Specify domains from which requests are allowed | |
header('Access-Control-Allow-Origin: *'); | |
// Specify which request methods are allowed | |
header('Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = array('http' => array('user_agent' => 'custom user agent string')); | |
$context = stream_context_create($options); | |
$response = file_get_contents('http://domain/path/to/uri', false, $context); |