Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Created June 4, 2015 16:00
Show Gist options
  • Save b4ldr/ef55fa677f1c7238b778 to your computer and use it in GitHub Desktop.
Save b4ldr/ef55fa677f1c7238b778 to your computer and use it in GitHub Desktop.
gelocation rest api
[ ~]$ fetch https://restcountries.eu/rest/v1/alpha/gm
fetch: https://restcountries.eu/rest/v1/alpha/gm: Forbidden
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
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