Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of using cors with Doorkeeper API
<html>
<head>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript">
$.ajax({
dataType: "json",
url: "https://api.doorkeeper.jp/events",
headers: { 'Authorization': 'Bearer your_token' },
data: {},
success: function(data) {
$( document ).ready(function(){
$( "code" ).text( JSON.stringify(data) )
})
}
});
</script>
</head>
<body>
<h1>API Response</h1>
<code></code>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment