无法从api网关获取x-amz-tagging值到s3 [英] Couldn't get the x-amz-tagging value from api gateway to s3

查看:217
本文介绍了无法从api网关获取x-amz-tagging值到s3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个aws API网关api将音频文件上传到s3,在标题中发送x-amz-tagging键值对,我在api的方法请求标题中得到了这个,但是在s3没有收到标签?

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用于调用api,api调用成功完成并且文件上传到s3但方法请求标题中的x-amz-tagging不存在于s3中的标签中

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

推荐答案

经过一些研究后我发现了一个解决方案,

After some research i found a solution,

在方法执行窗格中选择方法请求并选择HTTP请求标题,你可以添加标题,这里是x-amz-标记

Choose Method Request in your method execution pane and choose HTTP Request Headers and you can Add Header, Here its x-amz-tagging

以及

选择集成请求并展开HTTP标头并添加标题

Choose Integration Request and expand HTTP Headers and Add Header

此处,

API路由可以将客户端发送的URL路径部分,URL查询字符串参数和HTTP标头映射到要发送的HTTP标头集成请求:

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:

映射值:方法请求中定义的URL路径部分,URL查询字符串参数或HTTP标头。这些遵循命名约定method.request。{path| querystring| 报头}。{PARAM_NAME}。根据您是分别从URL路径,URL查询字符串还是HTTP标头进行映射,选择路径,查询字符串或标题之一。 param_name对应于显式指定给Method Request集中的参数的名称,即该参数需要首先在Method Request设置中定义。或者,将值包装在单引号中以表示静态值。例如。 'my_static_value'。

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'.

名称:您希望映射值映射到的HTTP标头名称。

Name: The HTTP header name you would like the mapping value mapped to.

这篇关于无法从api网关获取x-amz-tagging值到s3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆