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 |
---|
language | jsbash |
---|
title | TestGet request: Success |
---|
linenumbers | true |
---|
|
curl -X GET "http://127.0.0.1:4021/testGet?firstName=John&lastName=Smith" |
...
Code Block |
---|
language | js |
---|
title | TestGet Reponse: Success |
---|
linenumbers | true |
---|
|
{"result": true,"data": {"firstName": "John","lastName": "Smith"}} |
"testPost" API: Success
This API is exactly like testGet but uses the "post" method.
Code Block |
---|
language | js |
---|
title | TestPost request: Sucess |
---|
linenumbers | true |
---|
|
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"}' |
...