diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-21 20:32:21 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-21 20:32:21 +0800 |
commit | 1a30e82e02090f4c5b52387d3e278e38466e07bd (patch) | |
tree | 00cdb35f274c28dea1ad970cc45ad8416020c464 | |
parent | d64f068b01d4c9805ad4db0254bbf77957539c36 (diff) |
Pass upload data when method is POST
-rw-r--r-- | shopify.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |