Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- from requests.auth import HTTPBasicAuth
- url = 'https://api.pinnacle.com/'
- def request(api_method):
- username = 'х'
- password = 'х'
- URL = url + api_method
- headers = {
- 'Authorization': HTTPBasicAuth(username, password),
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- r = requests.get(URL, headers)
- return r.json()
- print(request('v2/sports'))
- {'code': 'INVALID_AUTHORIZATION_HEADER', 'message': 'HTTP Authorization header is missing'}
Add Comment
Please, Sign In to add comment