Created
June 4, 2015 16:00
-
-
Save b4ldr/ef55fa677f1c7238b778 to your computer and use it in GitHub Desktop.
gelocation rest api
This file contains 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
[ ~]$ fetch https://restcountries.eu/rest/v1/alpha/gm | |
fetch: https://restcountries.eu/rest/v1/alpha/gm: Forbidden |
This file contains 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
elinks Forbidden | |
You don't have permission to access /rest/v1/alpha/gm on this server. | |
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── | |
Apache/2.2.22 (Ubuntu) Server at restcountries.eu Port 443 |
This file contains 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
In [34]:l = requests.get('https://restcountries.eu/rest/v1/alpha/gm', verify=False) | |
In [36]: l.reason | |
Out[36]: 'Forbidden' | |
In [37]: l.text | |
Out[37]: u'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don\'t have permission to access /rest/v1/alpha/gm\non this server.</p>\n<hr>\n<address>Apache/2.2.22 (Ubuntu) Server at restcountries.eu Port 443</address>\n</body></html>\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment