Skip to content

Instantly share code, notes, and snippets.

@joshkh
Last active September 29, 2015 12:08
Show Gist options
  • Save joshkh/37bc127a522abae98059 to your computer and use it in GitHub Desktop.
Save joshkh/37bc127a522abae98059 to your computer and use it in GitHub Desktop.
IMJS 3.15.0-beta1 custom headers.
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn-dev.intermine.org/js/intermine/imjs/3.15.0/im-3.15.0-beta1.js"></script>
</head>
<body>
<script>
var customHeaders = {
"Authorization": "AIP-TOKEN-1234"
}
var flymine = new intermine.Service({
root: 'www.flymine.org/query',
token: "1NT3RM1N3T0K3N", // will be overriden by the custom authorization header in {customHeaders} above.
headers: customHeaders
});
flymine.fetchLists().then(function(lists) {
console.log("lists", lists);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment