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

326
Views
la variable de tipo de ruta en el punto final de Flask API está dividiendo el valor de la variable

Tengo un punto final en mi API como a continuación:

 from flask import Flask app = Flask(__name__) @app.route('/price/<path:url>/') def Ex(url): return {'urlwas':url} app.run()

El problema es que cuando llamo a la API con este http://127.0.0.1:5000/price/https://puresourceindia.in/store/index.php/?route=product/product&product_id=479

debería devolver este {"urlwas":"https://puresourceindia.in/store/index.php/?route=product/product&product_id=479"}

pero devuelve {"urlwas":"https://puresourceindia.in/store/index.php"}

No puedo entender lo que está sucediendo aquí y cómo abordar esta situación.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tienes que codificar la URL del parámetro, la llamada debería convertirse en:

 http://127.0.0.1:5000/price/https%3A%2F%2Fpuresourceindia.in%2Fstore%2Findex.php%2F%3Froute%3Dproduct%2Fproduct%26product_id%3D479

y el resultado entonces se convierte en el esperado:

 {"urlwas":"https://puresourceindia.in/store/index.php/?route=product/product&product_id=479"}

Vea aquí cómo codificar la URL de su cadena: https://www.urlencoder.org/

over 4 years ago · Santiago Trujillo Report
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!