Skip to content

Max-Wendel/pets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pets

Modelo do dado

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"
}

Test API

save

$ 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\"}"

list

$ curl -X GET "http://localhost:8080/pet/" -H "accept: */*"

get

$ curl -X GET "http://localhost:8080/pet/get/?id=5cfeb673e6682862496872b1" -H "accept: */*"

update

$ 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\"}"

delete

$ curl -X DELETE "http://localhost:8080/pet/delete?id=5cfeb673e6682862496872b1" -H "accept: */*"

Releases

No releases published

Packages

No packages published

Languages