From 8d3da012e13cd2bc6f10ec3430f43f28f7b422a2 Mon Sep 17 00:00:00 2001 From: Harsh Verma <55652117+Harsh3305@users.noreply.github.com> Date: Thu, 15 Jun 2023 20:29:42 +0530 Subject: [PATCH] Added delete request method (#13) --- src/main/kotlin/com/hrv/mart/apicall/APICaller.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/com/hrv/mart/apicall/APICaller.kt b/src/main/kotlin/com/hrv/mart/apicall/APICaller.kt index ae869a6..58b3046 100644 --- a/src/main/kotlin/com/hrv/mart/apicall/APICaller.kt +++ b/src/main/kotlin/com/hrv/mart/apicall/APICaller.kt @@ -40,4 +40,11 @@ class APICaller( .retrieve() .bodyToMono(responseClassType) } + fun deleteData(path: String, classType: Class): Mono { + val webClient = webClientBuilder.baseUrl(path) + .build() + return webClient.delete() + .retrieve() + .bodyToMono(classType) + } } \ No newline at end of file