diff options
| author | Xavier Del Campo <xavier.delcampo@midokura.com> | 2023-11-17 12:53:59 +0100 |
|---|---|---|
| committer | Xavier Del Campo <xavier.delcampo@midokura.com> | 2023-11-20 16:34:24 +0100 |
| commit | 1755ee663cd67cd8d9adf9f06dd82b0477adab76 (patch) | |
| tree | f5a4e78f8960a951c03c515aae9487da4a26d403 /include | |
| parent | 8f1ad3124e9e063ca0ee7c2548c747b20de3529d (diff) | |
http: Add support for PUT
Notes:
- Since curl would use the "Expect: 100-continue" header field for PUT
operations, this was a good operation to fix the existing issues in its
implementation.
Breaking changes:
- expect_continue is no longer exclusive to struct http_post. Now, it
has been moved into struct http_payload and it is up to users to check
it.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libweb/http.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/libweb/http.h b/include/libweb/http.h index ddb6a89..7af66b5 100644 --- a/include/libweb/http.h +++ b/include/libweb/http.h @@ -16,7 +16,8 @@ struct http_payload { HTTP_OP_GET, HTTP_OP_POST, - HTTP_OP_HEAD + HTTP_OP_HEAD, + HTTP_OP_PUT } op; const char *resource; @@ -30,7 +31,6 @@ struct http_payload { struct http_post { - bool expect_continue; const char *data; size_t nfiles, npairs; @@ -44,6 +44,11 @@ struct http_payload const char *name, *tmpname, *filename; } *files; } post; + + struct http_put + { + const char *tmpname; + } put; } u; const struct http_arg @@ -53,6 +58,7 @@ struct http_payload size_t n_args, n_headers; const struct http_header *headers; + bool expect_continue; }; #define HTTP_STATUSES \ |
