diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -227,8 +227,15 @@ eclat_send_request(CURL *curl, struct ec2_request *req) struct curl_slist *headers = NULL; /* Prepare the request */ + if (req->flags & EC2_RF_POST) { + eclat_request_finalize(req); + curl_easy_setopt(curl, CURLOPT_POST, 1); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, req->postdata); + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, + strlen(req->postdata)); + } eclat_request_sign(req, secret_key, signature_version); - url = eclat_request_to_url(req, NULL); + url = eclat_request_to_url(req); curl_easy_setopt(curl, CURLOPT_URL, url); debug(ECLAT_DEBCAT_MAIN, 1, ("using URL: %s", url)); free(url); @@ -263,6 +270,9 @@ eclat_send_request(CURL *curl, struct ec2_request *req) curl_easy_strerror(rc)); } + if (req->flags & EC2_RF_POST) + debug(ECLAT_DEBCAT_MAIN, 1, ("DATA: %s", req->postdata)); + if (dry_run_mode) debug(ECLAT_DEBCAT_MAIN, 1, ("not sending request")); else { |