From 3a22f203fa32146ed597557e93338606a333e5da Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 7 Jul 2020 21:31:49 +0200 Subject: 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. --- aws/request.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'aws') 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 -- cgit v1.2.3