Некоторая ошибка json api: неверная длина массива символов или строки Base-64Python

Программы на Python
Гость
Некоторая ошибка json api: неверная длина массива символов или строки Base-64

Сообщение Гость »


Если я запущу этот код,

Код: Выделить всё

conn = http.client.HTTPSConnection("api.icicidirect.com")
payload = json.dumps({})
#time_stamp & checksum generation for request-headers
time_stamp = datetime.utcnow().isoformat()[:19] + '.000Z'
checksum = hashlib.sha256((time_stamp+payload+API_SECRET).encode("utf-8")).hexdigest()
headers = {
'Content-Type': 'application/json',
'X-Checksum': checksum,
'X-Timestamp': time_stamp,
'X-AppKey': API_KEY,
'X-SessionToken': Session_Token
}
conn.request("GET", "/breezeapi/api/v1/dematholdings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
I get

Код: Выделить всё

{"Status":5,"Error":"Invalid length for a Base-64 char array or string."}
after referring to the documentation, https://api.icicidirect.com/breezeapi/d ... atholdings.
Question: Am I missing anything?


Источник: https://stackoverflow.com/questions/734 ... -or-string

Вернуться в «Python»