Class
data class Pet(
@Id
var _id:ObjectId = ObjectId.get(),
var name:String = "",
var species:String = "", //cat, dog, bird and go on
var breed:String = ""
)
JSON
{
"id": "5cfeb673e6682862496872b1",
"name": "Salem Saberhagen",
"species": "cat",
"breed": "American Shorthair"
}
$ curl -X POST "http://localhost:8080/pet/save/" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"id\": \"5cfeb673e6682862496872b1\", \"name\": \"Salem Saberhagen\", \"species\": \"cat\", \"breed\": \"American Shorthair\"}"
$ curl -X GET "http://localhost:8080/pet/" -H "accept: */*"
$ curl -X GET "http://localhost:8080/pet/get/?id=5cfeb673e6682862496872b1" -H "accept: */*"
$ curl -X PUT "http://localhost:8080/pet/update/?id=5cfeb673e6682862496872b1" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"name\": \"Scooby\", \"species\": \"dog\", \"breed\": \"Great Dane\"}"
$ curl -X DELETE "http://localhost:8080/pet/delete?id=5cfeb673e6682862496872b1" -H "accept: */*"