Sorry I have been a backend developer and my question may look dump; my apologies; I want to have a from and submit to an API endpoint which uses PUT method and based on that if the result is 200 or 400 I want to redirect to different pages; so what I have done so far:
<form class="form-signin" method="PUT" action="MY_API">
<h2 class="form-signin-heading">Please sign in</h2>
<input class="form-control" type="text" required name="email" placeholder="Email address">
<input class="form-control" type="password" required name="password" placeholder="Password">
<input class="form-control" type="text" required name="name" placeholder="name">
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
But after submitting it goes to the url from action as GET data, why is that?!
When I submit the page to the API endpoint I want to check the HTTP status code and based on that redirect to different pages.
Also, it is worth mentioning I'm open to any solution which is the fastest(in terms of implementation) and easiest one either pure javascript, JQuery,...
Thanks