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 <kaiserbh@proton.me>
This commit is contained in:
KaiserBh
2024-01-07 09:51:33 +11:00
parent eb5b1610d0
commit 0e3c958cfe

View File

@ -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,