1

I'm coding the Binance Exchange SPI and when I try to create order through rest API, there is some problem.

with the synchronous requests.post(), I got Response[200]:

url = self.rest_add + f"{order_url}?{query_string}&signature={signature}"
rsp = requests.post(url, headers=header)

However with the aiohttp, I got Response[400], and the binance response text said that my signature is invalid:

async with aiohttp.ClientSession(connector=connector) as session:
    async with session.post(url, headers=header) as rest_rsp:
        result = await rest_rsp.json()

Is there any difference between these two packages?

Answer from similiar question asynchronous aiohttp requests fails, but synchronous requests succeed doesn't work for me T^T

Armin Cao
  • 11
  • 3
  • you need to do a hash for the signature. SHA256(parameter body) with your secret key as hash key. Did you do the hashing? – Ice Jul 25 '22 at 10:02

0 Answers0