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

asked 5 years ago292 views
1 Answer
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

answered 5 years ago

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