REST Countries v1

फ़्री
द्वारा apilayer | अपडेट किया गया 한 달 전 | Data
लोकप्रियता

0.5 / 10

लेटेंसी

36ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Unirest in not supported in python 3

Rapid account: Majjiga Deepak
MajjigaDeepak
8년 전

Mentioned a light http protocol unirest to access countries api but unirest in not supporting in python 3.I request you to help me in resolving this or is there any other approach in accessing the api which has headers separately as an array?

Rapid account: Fayder
fayder Commented 8년 전

Hello there. First of all, you can access the REST Countries API directly, without mashape. And you also can use Python Requests library http://docs.python-requests.org/en/latest/

This way you wouldn’t need any headers. So, for example, a simple GET request would look like this:
<pre><code>

-- coding: utf-8 --

import requests

r = requests.get(‘https://restcountries.eu/rest/v1/name/colombia’)
print(r.text.encode(‘utf-8’))
</code></pre>

You can see all the available endpoints at: https://restcountries.eu

I hope this is useful

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें