I'm newbie in whole AWS universe and I'm trying to make a simple/test API. I'b like to send a plain text in a body of POST request but I can't.
The request - https://976c9euh34.execute-api.us-east-1.amazonaws.com/prod/moves/send
I get response:
{
"message": "Could not parse request body into json: Unrecognized token \'test\': was expecting \'null\', \'true\', \'false\' or NaN\n at [Source: (byte[])\"test\"; line: 1, column: 9]"
}
if I send POST with "test" body. I've tried put Content-Type: plain/text or plain/html but failed.
In the lambda I do not try to work with json. Let's say that now my lambda looks like this:
def lambda_handler(event, context):
file_path = str(time.time()) + '.txt'
s3 = boto3.client('s3')
data = "hello world"
try:
s3_response = s3.put_object(Bucket=BUCKET_NAME, Key=file_path, Body=data)
except Exception as e:
raise IOError(e)
return {
'statusCode': 200,
'body': {
'data': data
}
}
I see some related parameters in Integration Request like
but they don't affect at all.
How should I handle this issue? Where do I need to look at?
UPD:
The mapping alert:
PS: if I put json body it works fine

