request: Add request-query-string.
authorRicardo Wurmus <rekado@elephly.net>
Thu, 25 Feb 2021 14:19:20 +0000 (15:19 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Thu, 25 Feb 2021 14:20:44 +0000 (15:20 +0100)
* aws/request.scm (request-query-string): New procedure.

aws/request.scm

index 7ccb6c68a465d864406c94ef8999ad499341677d..45e725a707c5fd0efab91e804afd7f7514e1b0e3 100644 (file)
                               ".")
                  thing))))
 
+(define (request-query-string operation-name api-version input)
+  "Return a request query string."
+  (string-join (cons* (format #false "Action=~a" operation-name)
+                      (format #false "Version=~a" api-version)
+                      (if input
+                          (serialize-aws-value input)
+                          '()))
+               "&"))
+
 (define* (make-operation->request api-metadata)
   "Return a procedure that accepts an operation and returns an HTTP request."
   (define endpoint-prefix