Skip to content

Commit 6b6f6f5

Browse files
authored
Merge pull request #917 from greenbone/add-patch-to-httputils
Add: Add patch method support to httputils for agent controller
2 parents 3169e22 + ef8f678 commit 6b6f6f5

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

http/httputils.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@ gvm_http_new (const gchar *url, gvm_http_method_t method,
202202
curl_easy_setopt (curl, CURLOPT_POSTFIELDSIZE, strlen(payload));
203203
}
204204
break;
205+
case PATCH:
206+
if (payload && payload[0] != '\0')
207+
{
208+
curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, "PATCH");
209+
curl_easy_setopt (curl, CURLOPT_POSTFIELDS, payload);
210+
curl_easy_setopt (curl, CURLOPT_POSTFIELDSIZE, strlen(payload));
211+
}
212+
break;
205213
case DELETE:
206214
curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, "DELETE");
207215
break;

http/httputils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ typedef enum {
4141
POST,
4242
PUT,
4343
DELETE,
44-
HEAD
44+
HEAD,
45+
PATCH
4546
} gvm_http_method_t;
4647

4748
typedef enum {

0 commit comments

Comments
 (0)