Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

In this scenario, the request is sent with all the required input. The response should be a a JSON object containing the searched for object.

Code Block
languagejsbash
titleTestGet request: Success
linenumberstrue
curl -X GET "http://127.0.0.1:4021/testGet?firstName=John&lastName=Smith" 

...

Code Block
languagejs
titleTestGet Reponse: Success
linenumberstrue
{"result": true,"data": {"firstName": "John","lastName": "Smith"}}

"testPost" API: Success

This API is exactly like testGet but uses the "post" method.

Code Block
languagejs
titleTestPost request: Sucess
linenumberstrue
curl -X POST -H "Content-type:application/json" -H "Accept:application/json" "http://127.0.0.1:4010/testPost" -d '{"firstName":"John","lastName":"Smith","email":"john@smith.com"}'

...