]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change http methods in defines
authorBastian Dehn <hhaalo@arcor.de>
Sat, 27 Sep 2025 07:41:15 +0000 (09:41 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 27 Sep 2025 07:41:15 +0000 (09:41 +0200)
src/kds_s2000w_client.c

index b8e8132a5a5dc2011ed3ebdc63959dfef45a1363..daefb252e8241e5ac72fea294dba5448ce4c9ad1 100644 (file)
@@ -7,6 +7,9 @@
 
 #define MAX_STR_BUFFER_LENGTH  80
 
+#define HTTP_DELETE "DELETE"
+#define HTTP_PUT "PUT"
+
 #define X_STATUS_HEADER "x-status"
 #define CONTENT_TYPE_HEADER "Content-Type: application/json"
 #define ACCEPT_JSON_HEADER "Accept: application/json"
@@ -236,7 +239,7 @@ void kds_s2000w_client_close_session(int64_t sessionid)
        headers = curl_slist_append(headers, ACCEPT_JSON_HEADER);
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 
-       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
+       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, HTTP_DELETE);
        _kds_s2000w_client_set_ssl_verification_off(curl);
 
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
@@ -516,7 +519,7 @@ uint8_t kds_s2000w_client_delete_image(int64_t sessionid, uint8_t img_number)
        headers = curl_slist_append(headers, ACCEPT_JSON_HEADER);
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 
-       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
+       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, HTTP_DELETE);
        _kds_s2000w_client_set_ssl_verification_off(curl);
 
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
@@ -612,7 +615,7 @@ uint8_t kds_s2000w_client_set_option(int64_t sessionid, response* resp)
 
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, resp->data);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, resp->size);
-       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
+       curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, HTTP_PUT);
        _kds_s2000w_client_set_ssl_verification_off(curl);
 
        curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);