Does API Gateway overwrite headers for SageMaker Endpoint?

0

I have deployed a pytorch model as sagemaker endpoint which I am triggering using API gateway. I have created a POST method to trigger sagemaker endpoint as AWS Service. Below I have attached some images of my API gateway integration request config.

I have noticed that when I call my endpoint using python's requests library, the "Accept" header received by the sagemaker endpoint is always same as the "Content-Type" header of my python post request. It seems like whatever "Accept" header I pass to the API gateway, it overwrites the "Accept" header value with "Content-Type" header's value before passing it to sagemaker endpoint.

I have confirmed this behavior by logging my API gateway logs to cloudwatch as well as by logging headers inside sagemaker endpoint.

I am not sure what config is responsible for this behavior and I would like to figure out what is causing this issue. Can somebody help we with the above problem?

API gateway integration request config 1 API gateway integration request config 2

P.S. I haven't created any mapping templates

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions