From 1a30e82e02090f4c5b52387d3e278e38466e07bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Wed, 21 Sep 2022 20:32:21 +0800 Subject: Pass upload data when method is POST --- shopify.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3