diff options
| author | 2023-02-02 03:37:17 +0100 | |
|---|---|---|
| committer | 2023-02-02 03:37:17 +0100 | |
| commit | ec07b0c59d0313faedd147d08a65ade0feaf88b9 (patch) | |
| tree | acef4e76b7a5fddc7ae6207a48e1ac07a1dd056d /xs_curl.h | |
| parent | Moved the angry emoticon above the sad one to avoid clashes. (diff) | |
| download | penes-snac2-ec07b0c59d0313faedd147d08a65ade0feaf88b9.tar.gz penes-snac2-ec07b0c59d0313faedd147d08a65ade0feaf88b9.tar.xz penes-snac2-ec07b0c59d0313faedd147d08a65ade0feaf88b9.zip | |
Backport from xs.
Diffstat (limited to 'xs_curl.h')
| -rw-r--r-- | xs_curl.h | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -124,8 +124,8 @@ xs_dict *xs_http_request(char *method, char *url, xs_dict *headers, | |||
| 124 | curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd); | 124 | curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ipd); |
| 125 | curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback); | 125 | curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _data_callback); |
| 126 | 126 | ||
| 127 | if (strcmp(method, "POST") == 0) { | 127 | if (strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0) { |
| 128 | curl_easy_setopt(curl, CURLOPT_POST, 1L); | 128 | curl_easy_setopt(curl, method[1] == 'O' ? CURLOPT_POST : CURLOPT_PUT, 1L); |
| 129 | 129 | ||
| 130 | if (body != NULL) { | 130 | if (body != NULL) { |
| 131 | if (b_size <= 0) | 131 | if (b_size <= 0) |