North-Seattle-College / ad440-winter2022-tuesday-repo

North Seattle College AD 440 Winter 2020 Cloud Practicum class repoitory
Apache License 2.0
0 stars 4 forks source link

Adding a simple folde that has teacher feedback in post lambda #165

Closed TurkiBK closed 2 years ago

TurkiBK commented 2 years ago

close #46

Description

A lambda that accept the teacher feed back as input ,and output will be 201 ,and the teacher feed back .The lambda only excepts post request .It will return errs if the https method not post, or the feed back is empty.

Test

To test , 1- Use the lambda endpoint https://28o5v02966.execute-api.us-west-2.amazonaws.com/default/PostApiForTeacherFeedback 2- For postman , paste the endpoint and make suer changing https to post method.Select body ,raw , and change text to json.After that , Sending a body in Json file such as that {"feedback ":" some feedback form teacher "} ,and select send at the top right corner .The result should be 201 and teacher feedback.

Using terminal

  1. curl -d '{"feedback":"Good job!"}' -H "Content-Type: application/json" -X POST https://p9y9bbcruj.execute-api.us-west-2.amazonaws.com/default/simplePostLambda
  2. getting response with 201 when it is succeed

Screen Shot 2022-02-08 at 9 57 18 PM

Screen Shot 2022-02-08 at 9 57 35 PM

Screen Shot 2022-02-09 at 11 29 39 AM