Last active
February 7, 2018 10:28
-
-
Save rg3915/b0ed272af07d09aaaf8badd697714f53 to your computer and use it in GitHub Desktop.
Api GitHub with Python and Ajax example
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<!-- jQuery --> | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
</head> | |
<body> | |
<script> | |
$.get('https://api.github.com/users/rg3915', function(data) { | |
console.log(data); | |
}); | |
</script> | |
</body> | |
</html> |
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
import requests | |
url = 'https://api.github.com/users/rg3915' | |
response = requests.get(url) | |
print(response.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment