kdanedesigns / kdpcapstone-AD440-2023-EasilySendDataSecurely

Winter 2023 AD440 Cloud Practicum Team Project
GNU General Public License v3.0
2 stars 0 forks source link

Testing/Bug: Encryption Code error "statusCode": 500, "body": "{\"error\":\"Unexpected token u in JSON at position 0\"}" #98

Open kdpcapstone opened 1 year ago

kdpcapstone commented 1 year ago

I was re-testing the original and the new code with Lambda, because I was getting an error with both sets of code: Response { "statusCode": 500, "body": "{\"error\":\"Unexpected token u in JSON at position 0\"}" } I came across the following, that will likely be relevant to the format the data should be sent in when everything is hooked up. // // Create Lambda Test JSON using the body example below: // // Note that the body is a stringified JSON, because API Gateway Lambdas expect event body in a stringified format. // // { // // "body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}" // // } e.g., it didn't work setting up the test function with: { "message": "testing encryption 1 2 3", "key": "a98dgahdff988709df" } but it did when I set up the test function with: { "body": "{\"message\":\"Test Data to Encrypt 2023-02-12T18:45:03.608Z\",\"key\":\"586poj4dsii988\"}" } 7:03