angularjshttp-posthippocms

How to update content through a REST API call in Hippo CMS?


In Hippo CMS, I created a new content type, created new content of the said type as admin from the Hippo CMS UI and created a REST endpoint. I'm reading the data from an Angular web app through a REST API call (GET). To update or delete the content, I have to login as admin and change the content. Is there a way that I can update or delete the content in Hippo CMS using DELETE or POST REST API call?

I looked at this reference: https://www.onehippo.org/labs/rest-resources-and-hippo-cms.html. In ProductResource.java, there are @GET and @Path("/"). I understand that it takes GET requests. But I want to do something like @POST or @DELETE.


Solution

  • You can make use of the Persistable annotation. You might use this code as a starting point. If you need more details, you can find it on this documentation page