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

210
Views
Obtener JSON en JS desde la aplicación Flask da error JSON.parse

Tengo una configuración de la aplicación Python Flask como esta:

 @app.route("/") def getlist(): data = jsonify({"test": True, "name": "User", "teststring": "Hello, World!"}) return data if __name__ == '__main__': app.run(host='0.0.0.0', port=5050, debug=True)

Es muy simple y devuelve un diccionario jsonificado en la raíz ( / ) del dominio. Alojé este sitio como puede ver en localhost:5050 . Ahora, cuando uso JavaScript para buscar este JSON usando la API de fetch de esta manera:

 fetch("http://localhost:5050", { mode: "no-cors", // I added this due to some other error, called cross origin something }) .then((blob) => blob.json()) .then((data) => console.log(data));

Me sale este error en esta consola:

No detectado (en promesa) SyntaxError: JSON.parse: final inesperado de los datos en la línea 1, columna 1 de los datos JSON

pero la pestaña Red muestra 200 OK

respuesta de estado de la red

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!