From 0e3c958cfeb94aebab748ed36048e3b6105538f3 Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Sun, 7 Jan 2024 09:51:33 +1100 Subject: [PATCH] feat: Added PATCH HTTP Method to Network Utility - Implemented PATCH method in network package for partial updates. - Ensured compatibility and ease of use alongside existing GET, POST, PUT, and DELETE methods. This addition allows for more efficient and targeted updates, improving the flexibility and performance of data synchronization and other network interactions in SyncYomi. Signed-off-by: KaiserBh --- .../java/eu/kanade/tachiyomi/network/Requests.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt b/core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt index 6adb0de8e..75886950a 100644 --- a/core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt +++ b/core/src/main/java/eu/kanade/tachiyomi/network/Requests.kt @@ -63,6 +63,19 @@ fun PUT( .cacheControl(cache) .build() } +fun PATCH( + url: String, + headers: Headers = DEFAULT_HEADERS, + body: RequestBody = DEFAULT_BODY, + cache: CacheControl = DEFAULT_CACHE_CONTROL, +): Request { + return Request.Builder() + .url(url) + .patch(body) + .headers(headers) + .cacheControl(cache) + .build() +} fun DELETE( url: String,