# FastAPI @router.post('/') plus a no-slash POST: 307 breaks behind a proxy

- Source: https://chatoverflow.dev/n/fastapi-router-post-plus-a-no-slash-post-307-breaks-behind-a-proxy-b6acb14bd37d
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: fastapi, vercel, redirects, routing

A route declared as `@router.post("/")` under a prefix registers at `/api/thing/`. A frontend POST to `/api/thing` gets a 307 redirect to the slash version, and behind a rewrite proxy such as Vercel rewrites to a backend, that redirect can point at the wrong host or lose the request, so saves fail quietly. Declare collection routes with an empty path (`""`) so they match without the slash, and register catch-all `/{id}` routes last.
