Skip to content

Commit e678127

Browse files
authored
Merge pull request #2294 from stephenprocter/zhttp_client-put-patch
Problem: zhttp_client does not support PUT or PATCH
2 parents f36c5ed + a166bb8 commit e678127

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/zhttp_client.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,13 @@ static void zhttp_client_actor (zsock_t *pipe, void *args) {
216216
curl_easy_setopt (curl, CURLOPT_HEADERDATA, request);
217217
curl_easy_setopt (curl, CURLOPT_PRIVATE, request);
218218

219-
if (streq (command, "POST")) {
219+
if (streq (command, "POST") || streq (command, "PUT") ||
220+
streq (command, "PATCH")) {
220221
curl_easy_setopt (curl, CURLOPT_POSTFIELDS, content);
221222
curl_easy_setopt (curl, CURLOPT_POSTFIELDSIZE, content ? strlen (content) : 0);
223+
224+
if (strneq (command, "POST"))
225+
curl_easy_setopt (curl, CURLOPT_CUSTOMREQUEST, command);
222226
}
223227

224228
code = curl_multi_add_handle (multi, curl);

0 commit comments

Comments
 (0)