REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian...
Transcript of REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian...
![Page 1: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/1.jpg)
10/06/2009 1
REST–TheoryvsPractice
SubbuAllamarajuMikeAmundsen
![Page 2: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/2.jpg)
AbouttheSpeakers
SubbuAllamaraju Architect,Yahoo! Webservicesstandards/practicesatYahoo! Builtwebportals,andweb/WSservices(SOAPkind)frameworks(BEASystems)
MikeAmundsen IndependentConsultant .NET Long‐timeRESTafarian
10/06/2009 2
![Page 3: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/3.jpg)
10/06/2009 3
RESTfulWebServicesCookbookO’Reilly,March2010
![Page 4: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/4.jpg)
Objectives
RESTissetofconstraintsandnotrules Knowinglyrelaxconstraints Workwiththeplumbing Applysoundsoftwareengineering
10/06/2009 4
![Page 5: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/5.jpg)
RESTasExplained
1. Identifyresources2. GiveaURItoeveryresource3. Designrepresentationsforresources4. Operateusingauniforminterface5. Usehypermediaastheengineofapplication
state
10/06/2009 5
![Page 6: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/6.jpg)
10/06/2009 6
AddressBook1.0
BuildaRESTfuladdressbook
![Page 7: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/7.jpg)
GET /user/subbu/address/{id}Host: ex.org
200 OK ...PUT /user/subbu/address/{id}Host: ex.orgIf-Match: xyz
200 OK ...
POST /user/subbu/address-bookHost: ex.org
201 Created ...
Address Collection Resource
Address Resource
DELETE /user/subbu/address/{id}Host: ex.orgIf-Match: xyz
200 OK ...
10/06/2009 7
![Page 8: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/8.jpg)
<address> <link rel=“http://ex.org/rel/person” href=“http://ex.org/mike”/> <street>...</street> <city>...</city> ...</address>
10/06/2009 8
<address-book> <link rel=“http://ex.org/rel/owner” href=“http://ex.org/subbu”/> <link rel=“next” href=“http://ex.org/subbu/address-book?p=2/”/> <address>...</address> <address>...</address> ...</address-book>
![Page 9: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/9.jpg)
GET /user/subbu/address/{id}Host: ex.org
200 OK ...PUT /user/subbu/address/{id}Host: ex.orgIf-Match: xyz
200 OK ...
POST /user/subbu/address-bookHost: ex.org
201 Created ...
Address Collection Resource
Address Resource
DELETE /user/subbu/address/{id}Host: ex.orgIf-Match: xyz
200 OK ...
ResourcesURIs
Uniforminterface
10/06/2009 9
✔
✔
✔
![Page 10: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/10.jpg)
<address> <link rel=“http://ex.org/rel/person” href=“http://ex.org/subbu”/> <street>...</street> <city>...</city> ...</address>
10/06/2009 10
<address-book> <link rel=“self” href=“http://ex.org/subbu/address-book”/> <link rel=“next” href=“http://ex.org/subbu/address-book?p=2/”/> <address>...</address> <address>...</address> ...</address-book>
4 Representations
5 Applicationstate
![Page 11: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/11.jpg)
10/06/2009 11
Visibility
StatelessInteractions
UniformInterface
Self‐Describing
HTTPgoodies–caching,optimisticconcurrency,conneg,monitoring,analytics+others
![Page 12: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/12.jpg)
10/06/2009 12
AddressBook1.1
[UC]Supportaddressbooksyncformobileusers
![Page 13: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/13.jpg)
GET /user/subbu/address-book
ForeachaddressinthecollectionComparelocalcopy
PUT if different
DELETE if missing
POST if new
Address Collection Resource
Address Resource
Address Collection Resource
10/06/2009 13
![Page 14: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/14.jpg)
10/06/2009 14
Visibility
SeparationofconcernsNetworkefficiency
![Page 15: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/15.jpg)
10/06/2009 15
POST /user/subbu/address-book/mergeHost: ex.orgContent-Length: xxxContent-Type: application/xml;charset=UTF-8
<address-book> <address>...</address> <address>...</address> ...</address-book>
303 See OtherLocation: http://ex.org/user/subbu/address-book
BetterMerge
![Page 16: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/16.jpg)
10/06/2009 16
POST /user/subbu/address-book/mergeHost: ex.orgContent-Type: application/xml;charset=UTF-8
<address-book> <address>...</address> <address>...</address> ...</address-book>
303 See OtherLocation: http://ex.org/user/subbu/address-book
? Reducedvisibility
✔ Betterseparationofconcerns
✔ Efficientnetworkuse
![Page 17: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/17.jpg)
NetworkEfficiency
SeparationofConcerns
AtomicityandConcurrency
Protocol‐levelVisibility
Infrastructuresupport
Tradeoffs
10/06/2009 17
![Page 18: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/18.jpg)
10/06/2009 18
TakeaStepBack
![Page 19: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/19.jpg)
1.EverythingattheendofaURIisaresource
Some“things”
“person”, “address book”
andsomenon‐“things”
“merge address book”, “reserve”, “cancel”, “compute distance”, “reimage the virtual machine”
10/06/2009 19
![Page 20: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/20.jpg)
2.UsePOSTwhenindoubt
10/06/2009 20
GET Safe +IdempotentPUT Unsafe +IdempotentDELETE Unsafe +IdempotentPOST Unsafe +Non‐Idempotent
AllbetsareoffwithPOSTPOSTlimitsdamage
![Page 21: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/21.jpg)
3.Don’ttunnelusingPOST
10/06/2009 21
POST /address-book
Mergeanaddressbook?Fixduplicates?Orsomethingelse?
Tunneling=Backtodarkages
![Page 22: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/22.jpg)
10/06/2009 22
ProxyServer
WebServer
Browser(JSClient)
Dev:“WeshouldfindawaytomakeREST'faster'and/orprovidebatchingsupport”
Thisisnota“pedantic”pointofview
![Page 23: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/23.jpg)
10/06/2009 23
ProxyServer
WebServer
Browser(JSClient)
Batch“endpoint”
POST /batchHost: ex.orgContent-Length: xxxContent-Type: application/xml;charset=UTF-8
<batch> <request method=“PUT” uri=“/addr”>...</request> <request method=“GET” uri=“/poi”>...</request> <request method=“GET” uri=“/deals”>...</request> </batch>
Abenignsolution?
![Page 24: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/24.jpg)
10/06/2009 24
WebServer
Browser(JSClient)
ProxyServer
WebServer
Browser(JSClient)
BadGuy
Batch“endpoint”
ProxyServer
![Page 25: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/25.jpg)
10/06/2009 25
POST /updateAddressGetPoiDealsHost: ex.orgContent-Length: xxxContent-Type: application/xml;charset=UTF-8
<address> ...</address>
CreateapplicationspecificresourceswithdistinctURIs
POST /batchHost: ex.orgContent-Length: xxxContent-Type: application/xml;charset=UTF-8
<batch>...</batch>✗
✓
![Page 26: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/26.jpg)
4.BecreativewithURIs
FixedandknownURIs(CoolURIs)http://ex.org/user/subbu
ResourceswithmanyURIshttp://ex.org/user/1234/profile;t=3231231dasdhttp://ex.org/user/1234/profile;t=3da8432stgs
EphemeralURIs(UncoolURIs)http://ex.org/act/4567/status;t=rfdsf3adsd23dashttp://ex.org/act/transfer?f=12&t=32&sig=a359d72d424cbd913686435bc6e7e372
10/06/2009 26
![Page 27: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/27.jpg)
5.IDsarenotbad,butURIsarebetter
10/06/2009 27
Howmuch“hyper”media?Shouldyoucare?
PerformanceLoosecoupling
Separationofconcerns
Appcomplexity
![Page 28: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/28.jpg)
10/06/2009 28
<album>
<photoid=“1234”>...</photo>
<photoid=“5678”>…</photo></album>
<albumxml:base=“http://ex.org”>
<photo>
<linkhref=“/photo/1234”/>...</photo>
<photo>
<linkhref=“/photo/5678”/>...
</photo>
</album>
Bad?
Good?
![Page 29: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/29.jpg)
10/06/2009 29
Scheduleinterview
Enterfeedback
Hire
Nohire
Enterreferencechecks
Candidate
Candidate
Candidate
![Page 30: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/30.jpg)
10/06/2009 30
GET /transfer/token?from=1234&to=5678Host: ex.org
200 OK Content-Type: application/xml;charset=UTF-8
<token> <link rel=“http://ex.org/rels/transfer” href=“http://ex.org/transfer;9ihrdsadas”/> <from> <balance>...</balance> </from> <to> <balance>...</balance> </to> </token>
![Page 31: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/31.jpg)
10/06/2009 31
URIdecoupling *****
Applicationflow *****
Opaqueapplicationstate *****
![Page 32: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/32.jpg)
6.Managingconcurrency
10/06/2009 32
GET /subbu/address/1
200 OK Date: Mon, 28 Sep 2009 14:30:53 GMT Etag: “8cf498a1ca3ceb67fe50d401d4759e34” Last-Modified: Mon, 28 Sep 2009 01:30:53 GMT Cache-Control: public,max-age=3600
<address>...</address>
PUT /subbu/address/1If-Unmodified-Since: Mon, 28 Sep 2009 14:30:53 GMTIf-Match: “8cf498a1ca3ceb67fe50d401d4759e34”
412 Precondition Failed
![Page 33: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/33.jpg)
10/06/2009 33
GET /acct/1234
200 OK ETag: "f091aae21b44c71:6b9" Content-Type: application/xml;charset=UTF-8
<account> ... </address>
GET /acct/5678
...
POST /transferHost: ex.orgContent-Type: application/x-www-form-urlencoded
amount=1000&from=1234&to=5678...
![Page 34: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/34.jpg)
10/06/2009 34
GET /acct/1234
200 OK ETag: "f091aae21b44c71:6b9" Content-Type: application/xml;charset=UTF-8
<account> ... </address>
GET /acct/5678
...
POST /transferHost: ex.orgContent-Type: application/x-www-form-urlencoded
amount=1000&from=1234&to=5678...
✗ Noconcurrencycontrol
![Page 35: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/35.jpg)
GET /transfer/token?from=1234&to=5678Host: ex.org
200 OK Content-Type: application/xml;charset=UTF-8
<token> <link rel=“http://ex.org/rels/transfer” href=“http://ex.org/transfer;9ihrdsadas”/> <from> <balance>...</balance> </from> <to> <balance>...</balance> </to> </token>
10/06/2009 35
![Page 36: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/36.jpg)
POST /transfer/token;9ihrdsadasHost: ex.orgContent-Type: application/x-www-form-urlencoded
amount=1000
201 Created Location: http://ex.org/transfer/1234 Content-Type: application/xml;charset=UTF-8
<transfer> <created>2009‐09‐30T15:00:00Z</created> <from> <balance>...</balance> </from> <to> <balance>...</balance> </to> </transfer>
10/06/2009 36
✔ Concurrencycontrol
![Page 37: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/37.jpg)
7.Cachingisnotperfect
10/06/2009 37
HTTPServerCacheClient Data
Ideal–perfectlyvisible
![Page 38: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/38.jpg)
10/06/2009 38
Otherapps
HTTPServerCacheClient
Data
Data
Data
Client
CacheClient Cache
![Page 39: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/39.jpg)
10/06/2009 39
Everyrowisaresource
![Page 40: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/40.jpg)
10/06/2009 40
Overlappingdata
![Page 41: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/41.jpg)
10/06/2009 41
Someresourcesarelikehomepages
![Page 42: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/42.jpg)
10/06/2009 42
Noconditionalreads
Nowritesonoverlappingresources
Acceptstaleness
![Page 43: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/43.jpg)
Conclusion
Focusontradeoffs Relaxconstraintsjudiciously,butnotaccidentallyorbyignorance
PutHTTPanditsplumbingtogooduse
10/06/2009 43
![Page 44: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/44.jpg)
8.URIsforExtensibilityandVersioning
10/06/2009 44
HTTPmethodsarefixed
Newheadersmaygetdropped
Plumbingmaynotdifferentiatebetweenmediatypes
URIsareyourbestbet
![Page 45: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/45.jpg)
9.FocusonDesignTimeDiscovery
Runtimediscoveryworksgreatforbrowsers+humans,notformachineclients
Developersneeddesign‐timeinformation LeverageOPTIONSandconventionswheneverpossible
10/06/2009 45
![Page 46: REST – Theory vs Practice · portals, and web/WS services (SOAP kind) ... Long‐time RESTafarian 10/06/2009 2 10/06/2009 3 RESTful Web Services Cookbook ...](https://reader033.fdocuments.us/reader033/viewer/2022052021/60364cb30e53ec7a4607b525/html5/thumbnails/46.jpg)
Developersneeddesign‐timeinfo
Allresourcesandmethodssupportedforeach Mediatypesandrepresentationsforrequestsandresponses
Linkrelations,descriptions,expectedresources,mediatypes
AnyfixedURIsnotavailablevialinks QueryparametersforfixedURIs URItemplatesandtokenparsingrules
10/06/2009 46