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?

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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ