summaryrefslogtreecommitdiff
path: root/request.h
diff options
context:
space:
mode:
Diffstat (limited to 'request.h')
-rw-r--r--request.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/request.h b/request.h
index cfcc2a9..7c2c84f 100644
--- a/request.h
+++ b/request.h
@@ -50,13 +50,13 @@ static inline void request_graphql(const char *query,
char url[GRAPHQL_URL_LEN + strlen(session->shop) + 1];
sprintf(url, GRAPHQL_URL, session->shop);
curl_easy_setopt(curl, CURLOPT_URL, url);
+ curl_easy_setopt(curl, CURLOPT_POSTFIELDS, query);
struct curl_slist *list = NULL;
- curl_slist_append(list, "Content-Type: application/graphql");
char header[TOKEN_HEADER_LEN + strlen(session->access_token) + 1];
sprintf(header, TOKEN_HEADER, session->access_token);
curl_slist_append(list, header);
+ curl_slist_append(list, "Content-Type: application/graphql");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, query);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, append);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, json);
#ifdef DEBUG