summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-21 20:32:21 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-21 20:32:21 +0800
commit1a30e82e02090f4c5b52387d3e278e38466e07bd (patch)
tree00cdb35f274c28dea1ad970cc45ad8416020c464
parentd64f068b01d4c9805ad4db0254bbf77957539c36 (diff)
Pass upload data when method is POST
-rw-r--r--shopify.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shopify.c b/shopify.c
index 007d2fd..8df5314 100644
--- a/shopify.c
+++ b/shopify.c
@@ -351,7 +351,12 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con,
if (!strcmp(url, api->url)
&& !strcmp(method, api->method)) {
char *json = NULL;
- api->cb(api->arg, session, &json);
+ if (!strcmp(method, "POST")
+ && upload_data_size) {
+ api->cb(upload_data, session, &json);
+ *upload_data_size = 0;
+ } else
+ api->cb(api->arg, session, &json);
res = MHD_create_response_from_buffer(
strlen(json), json,
MHD_RESPMEM_MUST_FREE);