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

질문됨 4년 전474회 조회
1개 답변
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.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠