Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route doesn't exist

Tags:

python

flask

I have the following code on my service and when requested the return is always 404.

@app.route('/v1/auth/service', methods=['POST'])
def verifyAuthService():
    data = request.get_json()

But in the log file, the service returns 404.

127.0.0.1 - - [TIMEVALUE] "POST /v1/auth/service HTTP/1.1" 404 -

But it works when I use other route. I have checked if the route path or method name are duplicated and didn't find anything.

I request the service method with the following code:

r = requests.post("http://myservice.com:5001/v1/auth/service", json=jPayload)
like image 313
urb Avatar asked Feb 15 '26 19:02

urb


1 Answers

Maybe was a newbie error, in my init.py file, I haven't imported auth_services.py.

The /v1/auth/service route wasn't interpreted by python so, the route was inaccessible.

like image 152
urb Avatar answered Feb 18 '26 08:02

urb