#Please help me do my first POST of a form

1 messages · Page 1 of 1 (latest)

exotic ember
#

Hello,
I am developing an app with a REST API with SpringBoot for the backend, I have experience from doing the same work in a REST API with ASP.NET, so maybe that is contributing to the confusion. Here is the form in the view:

<div class="login-block">
    <form id="login-form" action="/authenticate" method="post">
        <input type="text" name="email" id="email" placeholder="Email">
        <input type="password" name="password" id="password" class="lock" placeholder="Password">

        <input type="submit" value="Login">
        <h3>Não tem conta? <a href="signup.html">Registe-se </a></h3>
    </form>
</div>

And here is the method I want it to call:

@PostMapping(path = "/authenticate")
public ModelAndView authenticate( @RequestParam("email") String email, @RequestParam("password") String password)
{
    //do stuff with the data
    return new ModelAndView("");
}

Right now, I get a 405 Method Not Allowed, with the browser console saying relative to the method "authenticate" it's trying to call: "No resource with given identifier found"
What should I do?

limpid gulchBOT
# exotic ember Hello, I am developing an app with a REST API with SpringBoot for the backend, I...

Detected code, here are some useful tools:

Formatted code
 < divclass  = "login-block" >  < form id = "login-form"action = "/authenticate"method = "post" >  < input type = "text"name = "email"id = "email"placeholder = "Email" >  < input type = "password"name = "password"id = "password"class  = "lock"placeholder = "Password" >  < input type = "submit"value = "Login" > <h3> Não tem conta ?  < a href = "signup.html" > Registe - se <  / a >  <  / h3 >  <  / form >  <  / div >
#

<@&1004656351647117403> please have a look, thanks.

exotic ember
#

Please keep in mind this is supposed to be a simple demo application and I'm new to SpringBoot and java in general, so I understand this may not all be the best practices, but I just need the POST to go through with the data

tribal hearth
#

whats the url that the request gets sent to?