Can you statically set the header, and this value when configuring an HTTP proxy using the AWS Api Gateway endpoint?

I am creating an http proxy using AWS Api Gateway. I would like to hard code some headers and their values ​​that will be sent as part of the request. I thought it was possible in the “Integration Request” section of the proxy server settings, but I cannot figure it out.

I am trying to pass the Authorization header with the oauth key. I do not want to share this key with clients who have access to this service, since I provide only part of the access to users of this particular endpoint.

+5
source share
2 answers

In the integration request, you can configure the value of the static header to be sent to the integration endpoint by placing the value inside single quotes, for example. 'my_static_header_value' .

+6
source

Is it a problem to put these hard-coded headers in the request body? This is not so, you can just use template (on the integration request screen):

 { "hardcoded_header": "$input.params('hardcoded_header')" } 

Hope this helps.

0
source

All Articles