4. REST
O Roy Fielding 2000年
O Representational State Transfer
O 資源(分布在網路上的東西)
O 表示方式(HTML、XML、JSON、Image…)
O 狀態轉換(Client端的操作行為)
O Architectural Styel(架構風格)
O HTTP 實作(RESTful Web Service)
5. REST & HTTP
O 資源的位置
O 由URI來表示
O 資源的操作方式
O 獲取、創建、修改和刪除資源
O GET 、POST 、PUT 、DELETE
O 資源的表現形式
O XML、JSON…
O Accept: application/xml(HTTP Header)
6. URI表示
O 服務
O 資源位置
O 參數
http://localhost:8888/Contact?Name=CHT
O 以名詞為種,用“/”表示階層
O http://crm2.hisales.hinet.net/webapi/SMSA
ctivity/{activityId}
O http://crm2.hisales.hinet.net/webapi/SMSA
ctivity/{activityId}/SMSLog
11. Open Data
Protocol(OData)
O 基於RESTful與Http所制定的協定
O 統一的資料表示方式
O Atom, JSON formats
O 統一的操作
O GET(select), POST(insert), PUT(update), DEL
ETE(delete)
O 統一的URL conventions
O Navigation, filtering, sorting, paging, etc.
O http://www.odata.org/
O http://odata.ntpc.edu.tw/(新北市教育局)
14. Operator by Odata 4.0
O Add
O eq
O le
O Div
O ne
O and
O Sub
O ge
O or
O Mod
O gt
O not
O Mul
O lt
http://www.odata.org/documentation/odata-v3documentation/url-conventions/
15. QueryOptions by Odata 4.0
O $skip
O $select
O $top
O $inlinecount("allpag
O $orderby
es" / "none")
O $format
O $expand
http://msdn.microsoft.com/en-us/library/dd541320.aspx
17. 誰在用Odata(2/2)
O Live Odata Service
O Facebook Insights
O Netflix
O Open Government Initiative
O Open Science Data initiative
O Etc..
O We can provide
O WCF Data Services
O OData4J
O ASP.NET Web API
20. ASP.NET Web API
O 1.0
O Visual Studio 2012
O ASP.NET MVC 4.0
O 2.0
O Visual Studio 2013(2013/10/18)
O ASP.NET MVC 5.0
O NuGet獨立下載
O Attribute routing、CROS、OWIN