mercredi 30 septembre 2015

Default Content-Type for Mapping Template

I'm working with a data provider for my project that does not adhere to any standards unfortunately, so no content-type specified within the header of the request. Actually it is specified, but with a different key then content-type.

The payload of the POST request is in xml format, so as far as I understand we need to use mapping template to wrap the payload in json object. All this works really great when we specify content-type to be one of the set up types in Integration Request part.

Now to my understanding if content-type is not specified in a request header then it should default to 'application/json' and execute mapping template associated with that type. In our case it behaves like it is ignoring the mapping template, which in turn results with following error returned:

{"Type":"User","message":"Could not parse request body into json."}

Just mention, the request is send for processing to AWS Lambda.

Any ideas how we can get that working ?

Edit: I have confirmed that the default is 'application/json' in case if the Content-Type is not set within the header. In that case I'm assuming what I'm experiencing is a bug.




Aucun commentaire:

Enregistrer un commentaire