amazon web services - Default Content-Type for Mapping Template -


i'm working data provider project not adhere standards unfortunately, no content-type specified within header of request. specified, different key content-type.

the payload of post request in xml format, far understand need use mapping template wrap payload in json object. works great when specify content-type 1 of set types in integration request part.

now understanding if content-type not specified in request header should default 'application/json' , execute mapping template associated type. in our case behaves ignoring mapping template, in turn results following error returned:

{"type":"user","message":"could not parse request body json."}

just mention, request send processing aws lambda.

any ideas how can working ?

edit: have confirmed default 'application/json' in case if content-type not set within header. in case i'm assuming i'm experiencing bug.

if you're not relying heavily on mapping template, can use lambda proxy intergration instead: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html

effectively transfers responsibility parsing body onto lambda function. event object include body string- regardless of headers api-gw pass body function deal with. allow parse body xml, though content-type header missing/invalid.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -