Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Pregunta de conversión de JS a Python (relacionada con la API REST)

Javascript de documentos

 const body = { name: "<replace with your credentials>", password: "<replace with your credentials>", appId: "Sample App", appVersion: "1.0", cid: 8, sec: "f03741b6-f634-48d6-9308-c8fb871150c2", deviceId: "123e4567-e89b-12d3-a456-426614174000" } const response = await fetch('https://live.tradovateapi.com/v1/auth/accesstokenrequest', { method: 'POST', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', }, body: JSON.stringify(body) })

Perdón por la crudeza de esta pregunta. Entiendo Javascript como entiendo Sumerian. ¿Cuál sería el equivalente de Python de esto?

Mi intento (en python ):

 @bot.command(pass_context=True) async def tradoMarket(symbol, side): url = 'https://demo.tradovateapi.com/order/placeorder' #url = 'https://live.tradovateapi.com/order/placeorder' headers = { "Content-Type": 'application/json', "Accept": 'application/json' } data = { "name": 'xxxxxx', "password": 'xxxxxx', "appId": 'xxxxxx', "appVersion": '1.0', "cid": xxxxxx, "sec": 'xxxxxx-xxxxxx-xxxxxx' } data_json = json.dumps(data) response = requests.post('https://demo.tradovateapi.com/v1/auth/accessTokenRequest', headers=headers, data=data_json) print(response.json())

Recibo una respuesta de su API. Esencialmente fue UN/PW incorrecto, pero estoy enviando al 100% la información correcta que me dice que mi formato es incorrecto.

Sus documentos como referencia

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!