can't send xml to non-Amazon REST API

0

I am submitting valid xml via POST to an external REST API site (at my location) from the AWS API Gateway. I have tried setting the Content-Type header as text/xml and application/xml.

On my server (the receiving end) I get an empty xml request as if the xml wasn't sent in the request body. The round trip for the API call works because my system sees this and returns the correct error to the Gateway. I know the API call should work because when I try the same API call from the Chrome Restlet extension, the request is successful.

How can I submit valid xml to my server from the AWS Gateway? Do I need to add a setting somewhere or use a different header?

Thanks,

Steverion

Edited by: Steverion on Jul 19, 2019 7:00 AM

Edited by: Steverion on Jul 19, 2019 8:02 AM

Edited by: Steverion on Jul 22, 2019 12:23 PM

Edited by: Steverion on Jul 23, 2019 7:10 AM

已提问 5 年前313 查看次数
1 回答
1

It turns out this is easy but not documented anywhere I could find. You have to set the header in 2 places:

  1. In the HTTP Request Headers in the Method request, you need to add the header Content-Type. There's no value entered there. I needed to add this to make it work.
  2. The value is also entered on the test page as a header :
    Content-Type: text/xml

Steverion

已回答 5 年前

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

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

回答问题的准则