By using AWS re:Post, you agree to the Terms of Use
/Appsync HTTP resolver supported content types/

Appsync HTTP resolver supported content types

0

Hi, I'm trying to write an Appsync http resolver mapping template to do a bulk upload to an Elastic Search index using this api: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html

This api expects content type "application/x-ndjson". However, appsync is giving me an error "unsupported content type application/x-ndjson". It appears "application/json" and "application/xml" are supported by appsync, but not sure if any others are

Is the list of supported content types for HTTP resolvers published somewhere? Is there any way I can get around this restriction? I just want the body to be passed through as a string. I don't need it to be parsed or serialized... not sure why the http resolver apparently has a whitelist of acceptable content types.

Thanks, cheers

Edited by: Michael J. Fogel on Dec 9, 2019 8:46 AM

Edited by: Michael J. Fogel on Dec 9, 2019 9:22 AM

1 Answers
1

The valid subtypes for the application content type are listed here:
https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-http.html#params-field

I made a code change to allow x-ndjson as well and that should be reflected in a couple of weeks as soon as it gets deployed.

answered 2 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