rest-calls.http 1.12 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
### Titanic API Calls
### Author: Praveen Chamarthi
@hostname = localhost
@port = 8000
@host = {{hostname}}:{{port}}
@contentType = application/json

### GET /people
GET http://{{host}}/people
Content-Type: {{contentType}}

### POST /people
# @name createrecord
POST http://{{host}}/people
Content-Type: {{contentType}}

{ 
    "survived": true, 
    "passengerClass": 3,
    "name": "Mr. Tom Brady",
    "sex": "male",
    "age": 99,
    "siblingsOrSpousesAboard": 1,
    "parentsOrChildrenAboard":0,
    "fare":7.25
}

### GET /people/id
@personId = {{createrecord.response.body.$._id}}
GET http://localhost:8000/people/{{personId}}

### DELETE /people/id
@personId = {{createrecord.response.body.$._id}}
DELETE http://{{host}}/people/{{personId}}

### PUT /people/id
@personId = {{createrecord.response.body.$._id}}
PUT http://{{host}}/people/{{personId}}
Content-Type: {{contentType}}

{ 
    "survived": true, 
    "passengerClass": 1,
    "name": "Mr. Tom Brady",
    "sex": "male",
    "age": 99,
    "siblingsOrSpousesAboard": 1,
    "parentsOrChildrenAboard":0,
    "fare":7.25
}

### Swagger Documentation
GET http://{{host}}/documentation