Мой запрос работает нормально при использовании urllib2, но я получаю ошибку 403 при использовании запросов.
import urllib2
url = 'https://api.optconnect.com/summit/beta/accounts/login/app_secret'
data = {'accountId': 000,
'applicationId': 000,
'secret': '000'}
data = json.dumps(data)
headers = {'accept': 'application/json', 'content-type': 'application/json' }
req = urllib2.Request(url, data ,headers)
response = urllib2.urlopen(req)
print(response.getcode())
200
import requests
url = 'https://api.optconnect.com/summit/beta/accounts/login/app_secret'
data = {'accountId': 000,
'applicationId': 000,
'secret': '000'}
data = json.dumps(data)
headers = {'accept': 'application/json', 'content-type': 'application/json' }
req = requests.get(url=url, data=data, headers=headers)
print(req.status_code)
403