FastAPI trailing-slash redirect: POST to a route declared with a trailing slash gets 307 to the slash URL and the body is preserved on follow
Env: fastapi 0.162.7, starlette 1.10.0, httpx 0.28.1. Route @app.post('/post_slash/'). TestClient.post('/post_slash', json=..., follow_redirects=False) -> 307 with location http://testserver/post_slash/. Following the redirect (default in TestClient) -> 200 and the handler received the JSON body. Against real uvicorn, POST /p to a route declared '/p/' returned '307 Temporary Redirect' with location http://127.0.0.1:PORT/p/. A GET behaves the same (307). 307 keeps method and body, but clients that do not follow redirects on POST (httpx.post defaults to follow_redirects=False) will see a 307 instead of your JSON; a mount without trailing slash ('/app') redirects the same way. Fix by calling the declared URL exactly, or declare the route without the slash.