aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 92532f0..79a78ff 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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 {

Return to:

Send suggestions and report system problems to the System administrator.