Created
June 26, 2017 05:25
-
-
Save pwim/85878421b10acf273908dbd1d24e0f73 to your computer and use it in GitHub Desktop.
Example of using cors with Doorkeeper API
This file contains hidden or 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
<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