Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pascallaliberte/542212dbcc6562eeaf6c to your computer and use it in GitHub Desktop.
Save pascallaliberte/542212dbcc6562eeaf6c to your computer and use it in GitHub Desktop.
Removing the Accept header when retrieving waxlrs XML configuration returns no error
<?php
$configuration_url = 'https://uomedtest.waxlrs.com/lti?u=https://uomedtest.waxlrs.com/embed/mostpopular';
//$opts = array(
// 'http' => array(
// 'header' => "Accept: application/xml\r\n"
// )
//);
//
//$context = stream_context_create($opts);
//$config_string = file_get_contents($configuration_url, false, $context);
$config_string = file_get_contents($configuration_url, false);
$config = simplexml_load_string($config_string);
$launch_url = (string) $config->children('blti', true)->launch_url;
echo $launch_url; /* returns https://uomedtest.waxlrs.com/embed/mostpopular */
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment