Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Deployed Blazor web site does not yield the same behavior on Http Post request as I get in development

$
0
0

I am developing this site, with login functionality.

I have this code in the login page:

var loginResponse = await httpClient.PostAsJsonAsync<LoginRequest>("/api/Account/Login", loginRequest);await js.InvokeVoidAsync("alert", $"Status = {loginResponse.StatusCode}");

And in the controller I have a post handler:

[HttpPost][Route("Login")][AllowAnonymous]public ActionResult<UserSession> Login([FromBody] LoginRequest loginRequest){    var jwtAuthenticationManager = new JwtAuthenticationManager(_userAccountService);    var userSession = jwtAuthenticationManager.GenerateJwtToken(loginRequest.UserName, loginRequest.Password);    if (userSession == null)        return Unauthorized();    return userSession;}

All of this works fine in development and status is returned as 200, but when I deploy to the test web server, the post returns 405

Could I be missing something in the deployment of the web server?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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