Posts

Showing posts from November, 2020

Sending CRUD (POST,GET,UPDATE,DELETE) messages to a Quarkus REST Service from an HTML Page.

Quarkus: Sending CRUD (POST,GET,UPDATE,DELETE) messages to a Quarkus REST Service from an HTML Page. Given the a simple REST Service in Quarkus for basic CRUD operations (Create, Read, Update, Delete) calling the Read operation is as simple as invoking a GET method from an HTML form. On the other hand, invoking Create, Update and Delete normally implies sending an ID and/or some Data to the service. HTML Forms allow basic GET and POST methods, but no UPDATE and DELETE are offered by them. To solve this situation JQuery AJAX calls are necessary. Let the following simple REST service be our target: package org . acme ; import javax . ws . rs . GET ; import javax . ws . rs . POST ; import javax . ws . rs . PUT ; import javax . ws . rs . Path ; import javax . ws . rs . Produces ; import javax . ws . rs . Consumes ; import javax . ws . rs . DELETE ; import javax . ws . rs . core . MediaType ; @ Path ( "/example/crud" ) public class CRUDResource { @ GET @ Produc