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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南