Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4053

FastAPI GET endpoint returns "405 method not allowed" response

$
0
0

A GET endpoint in FastAPI is returning correct result, but returns 405 method not allowed when curl -I is used. This is happening with all the GET endpoints. As a result, the application is working, but health check on application from a load balancer is failing.

Any suggestions what could be wrong?

code

@app.get('/health')async def health():"""    Returns health status"""    return JSONResponse({'status': 'ok'})

result

curl http://172.xx.xx.xx:8080

return header

curl -I http://172.xx.xx.xx:8080


Viewing all articles
Browse latest Browse all 4053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>