Forum Discussion

gangclar's avatar
gangclar
Copper Contributor
Sep 22, 2023

POST method becomes GET in docker container

I'm developing .net 7 web application which has a login page which calls controller methods via POST to validate user login attempt. The web application is hosted in Debian bookworm and the login page works perfectly(first tested by console, dotnet app.dll, then run as service), however fails when running under docker container.

 

After going thru line-by-line console debug output, I realised that the POST method called upon by login page on the controller becomes GET and resulted in a 405.

 

I verify the above observation by writing a new method which is using GET instead, the 405 message is no longer existing and the login page worked. It's obvious that it's impossible to convert majority of POST methods to GET

 

How did the POST get translated to GET in a docker container?

Could be a bug with .net core running under docker container?

 

I'm using docker compose to start a Redis container follow by the .net 7 web application container which stores the session on Redis.

No RepliesBe the first to reply

Resources