0

I created an API Gateway Proxy Integration so I can access a HTTP API on an HTTPS site. This HTTP API return a .xml file that is being returned by the API Gateway. But this file is getting corrupted by the Gateway, don't know exactly why. I saw some similar situations and find out that I should add this on my HTTP Header (Integration Request):

Name      Mapped from
Accept    method.request.header.Accept

With that, when I send Accept:"application/vnd.ms-excel on my request, the file is returned OK.

Although, my problem is that I can't change the request. Is there a way that I can add this header on API Gateway without using lambda integration?

Thanks in advance.

BernardoMorais
  • 571
  • 2
  • 6
  • 14
  • 1
    Try setting "mapped from" to the value `'application/vnd.ms-excel'` *including* the single quotes (i.e. "map it from this exact string, not from something in the data structures"). But... from somewhere in the back of my mind, I suspect the actual issue may be that you need to set `Accept-Encoding` to `identity` in the request, to suppress a different value being sent by the client... and your test with this header is somewhat "accidentally fixing" the problem. – Michael - sqlbot Oct 23 '18 at 23:40
  • @Michael-sqlbot, that's was a very good idea but unfortunately didn't work.. Looks like the request to API Gateway should have the Accept header with `application/vnd.ms-excel` instead of the request for another API. I tried to make a lambda integration but I facing the same problem – BernardoMorais Oct 24 '18 at 13:45
  • 1
    [Here](https://stackoverflow.com/q/44815649/1695906) is what I was remembering about `Accept-Encoding: identity`. Hard to say what the problem is that you are having, but I suspect you will need to get a little closer to the wire level and develop a more thorough understanding of precisely where things are going awry, before a fix or workaround can successfully be identified. – Michael - sqlbot Oct 24 '18 at 14:22

0 Answers0