Search code examples
jakarta-eexpageslotus-dominohcl-notes

@PUT with OpenNTF XPages Jakarta EE


I am playing around with the OpenNTF Project "XPages Jakarta EE Support".

I'm trying to setup a REST API for CRUD operations on a Person object. I managed to create GET and POST requests, but on a PUT request, I get an error in PostMan.

My code to update a request using POST is like this:

@POST
@Path("/update/{id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Response update(@PathParam("id") String id, Person p) {
   //TODO save person object
   return Response.ok().type(MediaType.APPLICATION_JSON).entity(p).build();
}

This works fine, but when I change the @POST in @PUT, I get a 405 Method Not Allowed:

Unable to Process Request

Http Status Code: 405

Reason: Request method is not allowed by the server

Is @PUT supported in the OpenNTF project?


Solution

  • PUT and DELETE are not enabled by default. Open/create an "Internet Site" document in your Domino Directory and enable PUT (and DELETE).

    enter image description here