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

381
Views
Componentes de ruta de ruta Starlette/FastApi con barra diagonal

He definido una ruta en Starlette/FastApi -

 @router.post("/{part}") def post_method(part): return "ok" @router.post("/{part}/{another_part}") def another_post_method(part, another_part): return "ok"

Tengo una barra inclinada en los componentes de la ruta y quiero realizar la siguiente solicitud para acceder a post_method

curl -X POST "http://127.0.0.1:5000/api/path%2Fpath" -H "accept: application/json" -d ""

da como resultado el error 404 en los registros de Starlette/Fastapi.

INFO: 127.0.0.1:50233 - "POST /api/path/path HTTP/1.1" 404

¿Cómo obtener los componentes de ruta correctos?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puede usar el convertidor de rutas integrado de Starlette

 @app.route("/path/{param:path}", name="path-convertor")
over 4 years ago · Santiago Trujillo Report

0

Respuesta de Marcelo Trylesinski (Kludex) en fastapi gitter :

  1. No esta permitido
  2. Solución temporal: no use la ruta
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!