Pass custom header to http endpoint via api gateway

0

I am passing a custom header x-api-testing-latency to my api. It basically has value in miliseconds and API uses the value to add latency to execution. This is for testing different use cases of client(app).

It works when I directly access the http endpoint, but while on hitting the endpoint via api gateway headers are filtered and not received by application.

How should it should be solved?

已提问 9 个月前465 查看次数
1 回答
0

Hi there.

I believe this could be achieved using Data Transformation. According to the documentation:

In API Gateway, an API's method request can take a payload in a different format from the integration request payload. Similarly, the backend may return an integration response payload different from the method response payload. You can map URL path parameters, URL query string parameters, HTTP headers, and the request body across API Gateway using mapping templates.

Please let me know if this helps.

profile pictureAWS
专家
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则