diff src/core/http.cc @ 389:1e5d922fe82b

kitsu: implement UpdateAnimeEntry yay... i guess
author Paper <paper@tflc.us>
date Thu, 06 Nov 2025 12:21:35 -0500
parents aa38b904de4f
children 2d3e10319112
line wrap: on
line diff
--- a/src/core/http.cc	Thu Nov 06 09:53:06 2025 -0500
+++ b/src/core/http.cc	Thu Nov 06 12:21:35 2025 -0500
@@ -82,8 +82,10 @@
 			list = curl_slist_append(list, h.c_str());
 
 		curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
-		if (type == Type::Post)
+		if (type == Type::Post || type == Type::Patch)
 			curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str());
+		if (type == Type::Patch)
+			curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
 		curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
 		curl_easy_setopt(curl, CURLOPT_WRITEDATA, &userdata);
 		curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &WriteCallback);
@@ -165,7 +167,7 @@
 	if (curl) {
 		curl_easy_setopt(curl, CURLOPT_URL, url_.c_str());
 
-		if (type_ == Type::Post)
+		if (type_ == Type::Post || type_ == Type::Patch)
 			curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data_.c_str());
 
 		for (const std::string &h : headers_)