Requests
Installing & Making a Request
To use Unirest for Python, install it using pip:
$ pip install requests
If you prefer to use Pipenv for managing Python packages, you can run the following:
$ pipenv install requests
After installing the pip package, you can now begin making API requests by importing Requests and forming a request:
import requests
url = "{{API_URL}}"
payload = "{}"
headers = {
'x-rapidapi-key': "{{API_KEY}}",
}
params = {
}
response = requests.request("{{HTTP_METHOD}}", url, data=payload, headers=headers, params=params)
print(response.text)
Updated about 4 years ago