method not allowed (python/fastapi)
Hello,
I've just tested python app locally and it was working alright.
Now deployed it successfully and the port was detected from dockerfile, all good.
But then checking the deploy logs, I see a redirect on my post then hitting to get and throwing a method not allowed err and idk why:
Project:
56a9f5e1-f542-4450-9860-623ac58b1b47
endpoint:
https://face-detection-production-76b4.up.railway.app/detect_faces
to reproduce, send a post request to above endpoint with a multipart/form-data, body being a form data with key
file
and type file, then selected an image file from your computer.
here's the code:
https://github.com/stateful-art/face-detectionGitHub
GitHub - stateful-art/face-detection
Contribute to stateful-art/face-detection development by creating an account on GitHub.
13 Replies
Project ID:
56a9f5e1-f542-4450-9860-623ac58b1b47
little clarity needed here -
the port was detected from dockerfilerailway does not detect ports from the dockerfile, it is instead done by simply looking at what networked applications are running.
to reproduce, send a post request to above endpoint with a multipart/form-data, body being a form data with key file and type file, then selected an image file from your computer.i did this and got a
500 Internal Server Error
responseit is not properly working for all images yet, even in local setup sometimes throwing 500.
use this maybe :/
lol okay
I get that post, 403 redirect then get request/method not allowed thing with this
are you sure you are making the request with https
yep. the only diff was the / at the end. now workd for me too
https://face-detection-production-76b4.up.railway.app/detect_faces/
Solution
without / at the end doesnt work
wtf hmm
@app.post("/detect_faces/")
now I know why
lol
there ya go
thank u at least we know it works 🙂
hmm, how do I resolve this? there's something w closing