How to Delete a resource in a REST Endpoint¶
A resource in a REST endpoint can be deleted using 'DELETE' http method with the reource URL. This can be initiated using EVENT_BIZAPI message flow.
PROCEDURE boston_rest_delete_rec IS
url_params_ PLSQLAP_DOCUMENT_API.Document;
BEGIN
url_params_ := PLSQLAP_DOCUMENT_API.New_Document('URL_Parameters');
PLSQLAP_DOCUMENT_API.Add_Attribute(url_params_,'p1', 'ifs/boston');
plsql_rest_sender_API.Call_Rest_EndPoint_Empty_Body2(
rest_service_ => 'DELETE_BOSTON_REC',
url_params_ => url_params_,
callback_func_ => 'P_L_S_Q_L_Rest_Test_API.REST_callback_Test',
http_method_ => 'DELETE');
END boston_rest_delete_rec;
Important points to consider:
- To send a DELETE request you have to call the PL/SQL method plsql_rest_sender_API.Call_Rest_EndPoint_Empty_Body(..) or plsql_rest_sender_API.Call_Rest_EndPoint(..) PL/SQL methods according to your requirements.
- If you need to include a payload with the request, you can do so by configuring the ifs property ifs.includeBodyInRestDelete = true.