summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-07-07 21:31:49 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-07-07 21:33:25 +0200
commit3a22f203fa32146ed597557e93338606a333e5da (patch)
tree1ca29abcd4d30edad81c2ac71835867ad8aa0073
parentb88ce25b3e8398d28139b5778fa92d6c6699082c (diff)
aws/request: make-operation->request: Use requested HTTP method.
Don't just use POST; use whatever method the API operation requires. Only add a request body for POST requests. * aws/request.scm (make-operation->request): Use HTTP-REQUEST instead of HTTP-POST.
-rw-r--r--aws/request.scm15
1 files changed, 10 insertions, 5 deletions
diff --git a/aws/request.scm b/aws/request.scm
index 764ed43..d7e0822 100644
--- a/aws/request.scm
+++ b/aws/request.scm
@@ -33,8 +33,9 @@
;;; Commentary:
;;; See: http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
-;;; Make a POST request and pass request parameters in the body of the
-;;; request. Auth information is provided in an Authorization header.
+;;; Make a request to the AWS API and pass request parameters in the
+;;; body of the request. Auth information is provided in an
+;;; Authorization header.
;;; Code:
@@ -244,9 +245,13 @@
(call-with-values
(lambda ()
- (http-post endpoint
- ;#:method (string->symbol method)
- #:body (string->utf8 request-parameters)
+ (http-request endpoint
+ #:method (string->symbol method)
+ #:body
+ (match method
+ ("POST"
+ (string->utf8 request-parameters))
+ (_ ""))
#:headers new-headers))
(lambda (response body)
(xml->sxml (match body