I created a simple api that reads from json file (passed as input) a key and checks in a database if is present if I test it locally
serverless invoke local --function getVin --path input/input_212.json
works
how can I test with curl once deployed on AWS?
I am trying with
curl --request GET 'https://xxxx.execute-api.us-east-1.amazonaws.com/dev/vin' --header 'content-type: text/plain' --data-raw @input.json
or
curl -H "Content-Type: application/json" -X GET -d '{
"CustomerId": 213,
"VIN": "WDBJF65J1YB039213"
}' https://xxxxx.execute-api.us-east-1.amazonaws.com/dev/vin
but does not work with this error
curl -H "Content-Type: application/json" -X GET -d '{
"CustomerId": 213,
"VIN": "WDBJF65J1YB039213"
}' https://xxxxx.execute-api.us-east-1.amazonaws.com/dev/vin
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: iMPlncZFM2NQcVwotAWQmbear6akaktsKVTyin6Mmqcd7T5z0_Vijw==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>%
the input json is something like this
{
"key1": 1,
"key2": "abcdefg"
}