I am working on a Java Web application Project (Maven Project) using Jersey (JAX-RS).
With postman requests, I am able to process the @DELETE/@PUT requests. but when I am trying to implement those methods in frontend the browser will always show an Error (405 – Method Not Allowed).
I know that HTML doesn't support DELETE/PUT method, but is there a <form method="delete/put">
?
or is it even possible to process those requests through the browser?
Thanks
backend Implementation:
@PUT
@Path("/edit/{id}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(APPLICATION_JSON)
public Person editUser(
@PathParam("id") Long id,
Student user) {
return repository.update(user, id); //update User
}
@DELETE
@Path("/delete/{id}")
@Produces(APPLICATION_JSON)
public Person deleteUserById(@PathParam("id") Long id) {
return repository.delete(id); //delete User
}