Understanding and testing RESTful Web Services - Created by Mark Winteringham / @2bittester © 2016
Available at http://mwtestconsultancy.co.uk/presentations/understanding_web_service/
Stateless
Each request should contain all the neccesary information and each response should contain all session state dataCacheable
Service consumers can cache and reuse response message dataUniform Interface
Service consumers and services share a common, overarching, generic technical contractClient-Server
Solution logic is separated into consumer and service logic that share a technical contractLayered System
A solution can be comprised of multiple architectural layersCode on Demand
Service consumers support the execution of deferred service logicLevel 3: | Hypermedia Controls |
Level 2: | HTTP Verbs |
Level 1: | Resources |
Level 0: | Swamp of POX |
"booking": {
"firstname": "Sally",
"lastname": "Brown",
"totalprice": 111,
"depositpaid": true,
"bookingdates": {
"checkin": "2013-02-23",
"checkout": "2014-10-23"
}
}
"bookings" : [
{
"bookingid": 1,
"bookingdetails": {
...
}
},{
"bookingid": 2,
"bookingdetails": {
...
}
},{
"bookingid": 3,
"bookingdetails": {
...
}
}
]
Level 3: | Hypermedia Controls |
Level 2: | HTTP Verbs |
Level 1: | Resources |
Level 0: | Swamp of POX |
"booking": {
"firstname": "Sally",
"lastname": "Brown",
"totalprice": 111,
"depositpaid": true,
"bookingdates": {
"checkin": "2013-02-23",
"checkout": "2014-10-23"
}
}
{
"bookingid": 2,
"bookingdetails": {
"firstname": "Sally",
"lastname": "Brown",
"totalprice": 111,
"depositpaid": true,
"bookingdates": {
"checkin": "2013-02-23",
"checkout": "2014-10-23"
}
}
Level 3: | Hypermedia Controls |
Level 2: | HTTP Verbs |
Level 1: | Resources |
Level 0: | Swamp of POX |
Create | = | POST |
Read | = | GET |
Update | = | PUT |
Delete | = | DELETE |
Level 3: | Hypermedia Controls |
Level 2: | HTTP Verbs |
Level 1: | Resources |
Level 0: | Swamp of POX |
<bookings> <bookingid>1</bookingid> <bookingid>2</bookingid> <bookingid>3</bookingid> <bookingid>4</bookingid> <bookingid>5</bookingid> <bookingid>6</bookingid> <bookingid>7</bookingid> <bookingid>8</bookingid> </bookings>
<ul> <li> <a href='http://localhost:3001/booking/1'> Booking </a> </li> <li> <a href='http://localhost:3001/booking/2'> Booking </a> </li> </ul>
<bookings> <booking> <id>1</id> <link> <rel>self</rel> <href>http://localhost:3001/booking/1</href> </link> </booking> <booking> <id>2</id> <link> <rel>self</rel> <href>http://localhost:3001/booking/2</href> </link> </booking> </bookings>
<ul> <li> <a href='http://localhost:3001/booking/1'> Booking </a> </li> <li> <a href='http://localhost:3001/booking/2'> Booking </a> </li> </ul>
Slides - http://mwtestconsultancy.co.uk/presentations/understanding_web_service/