def sellOrder(self, amount, price):

       

        url=self.binance_url+"/fapi/v1/order"                                        #api 주소

       

        servertime = requests.get("https://api.binance.com/api/v1/time")    #servertime을 받아옴(timestamp 파라미터로 같은 시간에 보낸건지 확인하는거떔에)

        servertimeobject = json.loads(servertime.text)

        servertimeint = servertimeobject['serverTime']

                

        #request body로 보낼 것들 딕셔너리

        request_body={

                    'symbol':'BTCUSDT',

                    'side': 'SELL',

                    'positionSide':'SHORT',

                    'orderType':'LIMIT',

                    'timeInForce':'GTC',

                    'quantity':float(amount),

                    'price': float(price),

                    'recvWindow':6000,

                    'timestamp':servertimeint

                    }

        

        request_body=self.encoding(request_body)   #딕셔너리 내용을 api키로 암호화(딕셔너리에 signature라고 전체 딕셔너리를 암호화한 키-밸류 하나를 넣음)

        headers={

                'X-MBX-APIKEY':self.API_KEY,                   #헤더로 넣을 내용들

                'Content-Type':'x-www-form-urlencoded'

                }

        

        req=requests.post(url, data=request_body, headers=headers)    #post로 url에 데이터를 바디로 보내고 헤더도 보냄

        response=json.loads(req.text)

        return response



이렇게 했는데 이 응답이 {'code': -1102, 'msg': "Mandatory parameter 'timestamp' was not sent, was empty/null, or malformed."}


이렇게 뜨는데 print(request_body)를 인코딩 행 뒤에 넣어도 timestamp키랑 값은 그대로 존재하고있는데, 자꾸 '필수 인자인 timestamp가 병신입니다.'라고


응답이 오는데, 내가 body로 안보내고 있는거야??


For POSTPUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded. You may mix parameters between both the query string and request body if you wish to do so.

Parameters may be sent in any order.

If a parameter sent in both the query string and request body, the query string parameter will be used.


이게 거래서 General API Information인데, Post는 인자를 쿼리열이나, content type이 www뭐시기인 request body로 보내면 되고,


파라미터는 순서 좆대로 해도 된다는 내용인데 왜 내가 body로 보낸 request_body에서 timestamp를 지 맘대로 빼냐 이거지... 혹시 도움 줄 수 있워??