问题
I have an aws API Gateway api to upload audio files to s3, sending x-amz-tagging key value pair in header , i get this in Method request headers of api , but the tags are not received at s3?
'x-amz-tagging': 'key1=value1&key2=value2'
postman is used to call the api , api call is successfully completed and the file uploaded to s3 but the x-amz-tagging in the method request header is not present in the tags in the s3
回答1:
After some research i found a solution,
Choose Method Request in your method execution pane and choose HTTP Request Headers and you can Add Header, Here its x-amz-tagging
and also
Choose Integration Request and expand HTTP Headers and Add Header
here,
URL path parts, URL query string parameters, and HTTP headers sent from the client in the Method Request can be mapped by API Gateway to a HTTP header to be sent in the Integration Request:
Mapping value: A URL path part, URL query string parameter or HTTP header defined in the Method Request. These follow the naming convention method.request.{"path" | "querystring" | "header"}.{param_name}. Choose one of path, querystring or header depending on whether you're mapping from a URL path, URL query string or HTTP header respectively. param_name corresponds to the name explicitly given to the parameter in the Method Request set, i.e. the parameter needs to have been defined in the Method Request setup first. Alternatively, wrap a value in single quotes for static values. E.g. 'my_static_value'.
Name: The HTTP header name you would like the mapping value mapped to.
来源:https://stackoverflow.com/questions/43341378/couldnt-get-the-x-amz-tagging-value-from-api-gateway-to-s3