aws/request: Use JSON for "rest-json" APIs.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 2 Mar 2021 21:57:31 +0000 (22:57 +0100)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 2 Mar 2021 21:57:31 +0000 (22:57 +0100)
aws/request.scm

index 630112e946d96f828f6bc5777d202eabdbafab83..e8ade5cf90ee8ca09b3076d7af0a56a65c9a4494 100644 (file)
@@ -217,6 +217,7 @@ corresponding value in INPUT."
     (define json?
       (match (assoc-ref api-metadata 'protocol)
         ("json" #true)
+        ("rest-json" #true)
         (_ #false)))
     (define content-type
       (if json?
@@ -337,7 +338,8 @@ corresponding value in INPUT."
                               (utf8->string bv))
                              ((? string? s) s))))
           (match (response-content-type response)
-            (('application/x-amz-json-1.1 . rest)
+            ((or ('application/x-amz-json-1.1 . rest)
+                 ('application/json . rest))
              (json-string->scm server-text))
             (('text/xml . rest)
              (xml->sxml server-text))