SlideShare a Scribd company logo
Web Service: REST  原則與實作分享 簡報者:許登傑、林宗茂 更新日期: 2008-09-01
大綱 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST 打哪來 ?  # 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST 打哪來 ?  # 2 Client (Server) Request:   GET https ://.../customers/1/orders Response:  Content-type:   XML https://.../orders/00131 https://.../orders/00832 https://.../orders/00759 Server db3n2u.sinica.edu.tw/~textdb/ap … /orders/ { id } POST /   GET / PUT / DELETE /customers/ { id } POST /   GET / PUT / DELETE /customers/ { id } /orders POST /   GET  / PUT / DELETE
REST 打哪來 ?  # 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST 打哪來 ?  # 4 ,[object Object],[object Object],[object Object],DELETE GET ○ X Delete ○ X Update create PUT ○ ○ Read X X Create update, delete POST Idempotent Safe CRUD Method
REST for rest  ♨  - Client  操作範例 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST for rest  ♨  - curl  指令操作範例 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST for rest  ♨  - curl  指令其他常用參數 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
REST for rest  ♨  -  在 C 語言中執行  curl ,[object Object],[object Object],[object Object],[object Object],[object Object]
REST for rest  ♨  - Server  開發思維 Uniform Interface
實作分享  # 1: DORE combined (Resource Template) header('Content-Type: application/vnd.google-earth.kml+xml; charset=utf-8'); echo $loader->run(); ,[object Object],[object Object],[object Object],RESPONSE $loader = new Loader(‘gismap'); $_roleList = '*'; $_webService0 = 2; require_once('../../dore/lib0.php'); $_sess->close(); <<interface>> REST restPost() restGet() restPut() restDelete() <<resource>> gismap err() usage() chkArgs() restPost() restGet() restPut() restDelete() <<handler>> Loader err() run() auth()
實作分享  # 2 (Resource Template) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
現行限制 & 框架支援 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
參考文獻 & 相關資源 ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

分析mysql acid 设计实现
分析mysql acid 设计实现分析mysql acid 设计实现
分析mysql acid 设计实现
rfyiamcool
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
Steven Pousty
 
DNS (BIND) on CentOS
DNS (BIND) on CentOSDNS (BIND) on CentOS
DNS (BIND) on CentOS
Md Tanjil Islam Bappi
 
Dns
DnsDns
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it Works
Mike Dirolf
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
Laurynas Biveinis
 
"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"
Badoo Development
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
Fwdays
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
YoungHeon (Roy) Kim
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
ruoyi ruan
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
Ladislav Prskavec
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング
nobu_k
 
Ilugc curl
Ilugc curlIlugc curl
Ilugc curl
Akilan Ram
 
Introduction HTTP via cURL
Introduction HTTP via cURLIntroduction HTTP via cURL
Introduction HTTP via cURL
Kyosuke MOROHASHI
 
Page compression. PGCON_2016
Page compression. PGCON_2016Page compression. PGCON_2016
Page compression. PGCON_2016
Anastasia Lubennikova
 
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
NETWAYS
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Ontico
 
HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증
박 민규
 
It’s about time to embrace Streams
It’s about time to embrace StreamsIt’s about time to embrace Streams
It’s about time to embrace Streams
Luciano Mammino
 
Nginx-lua
Nginx-luaNginx-lua

What's hot (20)

分析mysql acid 设计实现
分析mysql acid 设计实现分析mysql acid 设计实现
分析mysql acid 设计实现
 
Spatial script for MongoBoulder
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
 
DNS (BIND) on CentOS
DNS (BIND) on CentOSDNS (BIND) on CentOS
DNS (BIND) on CentOS
 
Dns
DnsDns
Dns
 
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it Works
 
XtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithmsXtraDB 5.7: key performance algorithms
XtraDB 5.7: key performance algorithms
 
"Развитие ветки PHP-7"
"Развитие ветки PHP-7""Развитие ветки PHP-7"
"Развитие ветки PHP-7"
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Redis深入浅出
Redis深入浅出Redis深入浅出
Redis深入浅出
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング
 
Ilugc curl
Ilugc curlIlugc curl
Ilugc curl
 
Introduction HTTP via cURL
Introduction HTTP via cURLIntroduction HTTP via cURL
Introduction HTTP via cURL
 
Page compression. PGCON_2016
Page compression. PGCON_2016Page compression. PGCON_2016
Page compression. PGCON_2016
 
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
 
HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증HTTP 완벽가이드- 13 다이제스트 인증
HTTP 완벽가이드- 13 다이제스트 인증
 
It’s about time to embrace Streams
It’s about time to embrace StreamsIt’s about time to embrace Streams
It’s about time to embrace Streams
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 

Similar to REST Web Sebvice

Curl Tutorial
Curl Tutorial Curl Tutorial
Curl Tutorial
Ankireddy Polu
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
Zoran Jeremic
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
Zoran Jeremic
 
Kubered -Recipes for C2 Operations on Kubernetes
Kubered -Recipes for C2 Operations on KubernetesKubered -Recipes for C2 Operations on Kubernetes
Kubered -Recipes for C2 Operations on Kubernetes
Jeffrey Holden
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
Building Portable Applications with Kubernetes
Building Portable Applications with KubernetesBuilding Portable Applications with Kubernetes
Building Portable Applications with Kubernetes
Kublr
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
Julien Vermillard
 
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesConf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
BrentMatlock
 
Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9
sumsid1234
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
Bram Vogelaar
 
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
sonjeku1
 
Docker tlv
Docker tlvDocker tlv
Docker tlv
Ariel Moskovich
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
Tiago Simões
 
mastering libcurl part 1
mastering libcurl part 1mastering libcurl part 1
mastering libcurl part 1
Daniel Stenberg
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
Pedro J. Molina
 
NSManchester - Restofire - 10 Feb
NSManchester - Restofire - 10 FebNSManchester - Restofire - 10 Feb
NSManchester - Restofire - 10 Feb
RahulKatariya14
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
Edorian
 
Construindo APIs Usando Rails
Construindo APIs Usando RailsConstruindo APIs Usando Rails
Construindo APIs Usando Rails
Fernando Kakimoto
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
Lorna Mitchell
 
Apache Solr
Apache SolrApache Solr
Apache Solr
Minh Tran
 

Similar to REST Web Sebvice (20)

Curl Tutorial
Curl Tutorial Curl Tutorial
Curl Tutorial
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Kubered -Recipes for C2 Operations on Kubernetes
Kubered -Recipes for C2 Operations on KubernetesKubered -Recipes for C2 Operations on Kubernetes
Kubered -Recipes for C2 Operations on Kubernetes
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
 
Building Portable Applications with Kubernetes
Building Portable Applications with KubernetesBuilding Portable Applications with Kubernetes
Building Portable Applications with Kubernetes
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpracticesConf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
Conf2015 d waddle_defense_pointsecurity_deploying_splunksslbestpractices
 
Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9Hacking Oracle From Web Apps 1 9
Hacking Oracle From Web Apps 1 9
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
 
Docker tlv
Docker tlvDocker tlv
Docker tlv
 
How to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysisHow to create a multi tenancy for an interactive data analysis
How to create a multi tenancy for an interactive data analysis
 
mastering libcurl part 1
mastering libcurl part 1mastering libcurl part 1
mastering libcurl part 1
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
NSManchester - Restofire - 10 Feb
NSManchester - Restofire - 10 FebNSManchester - Restofire - 10 Feb
NSManchester - Restofire - 10 Feb
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
 
Construindo APIs Usando Rails
Construindo APIs Usando RailsConstruindo APIs Usando Rails
Construindo APIs Usando Rails
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Apache Solr
Apache SolrApache Solr
Apache Solr
 

REST Web Sebvice

  • 1. Web Service: REST 原則與實作分享 簡報者:許登傑、林宗茂 更新日期: 2008-09-01
  • 2.
  • 3.
  • 4. REST 打哪來 ? # 2 Client (Server) Request: GET https ://.../customers/1/orders Response: Content-type: XML https://.../orders/00131 https://.../orders/00832 https://.../orders/00759 Server db3n2u.sinica.edu.tw/~textdb/ap … /orders/ { id } POST / GET / PUT / DELETE /customers/ { id } POST / GET / PUT / DELETE /customers/ { id } /orders POST / GET / PUT / DELETE
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. REST for rest ♨ - Server 開發思維 Uniform Interface
  • 12.
  • 13.
  • 14.
  • 15.

Editor's Notes

  1. Service-oriented architecture , a computer systems architectural style for creating and using business processes, packaged as services . http://en.wikipedia.org/wiki/Service-oriented_architecture IT 資源 &gt;&gt; 服務 ( 設計層次高於 function, component, procedure) Web Service : Web APIs that can be accessed over a network, 可實現 xOA 的技術集合 http://en.wikipedia.org/wiki/Web_service RPC : distributed function (method) call interface. Mapping directly language-specific functions. SOAP : message, rather than an operation. REST : interacting with stateful resources. Roy Fielding , one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification. Style : (guideline) network architecture principles, outline how resources are defined and addressed. (Simple interface, Domain-specific data, Non-additional info) distributed hypermedia systems : such as the World Wide Web. ROA : 2007 book, RESTful Web Services. Every resource is a service. (Four concepts, four properties)
  2. https: TCP/IP model &gt; Application Layer &gt; HTTP
  3. Four concepts Resource : could be a physical resource, or even a person. Can be described by a representation. Name : URI for use in hypermedia links. Representation : HTTP header Content-type, describe the resource (XML / HTML / JSON / link). Link to : response to other resources. Four properties Addressability : set as URIs and allows clients to manipulate their state. Uniform interface : verbs reacting criteria (GET / PUT / POST / DELETE). Statelessness : server only keeps resource state; client keeps application state. Connectedness : have a set of links (URIs). REST principle &gt; protocol : client-server, stateless, cacheable, layered (intermediaries)
  4. WSDL: an XML -based language that provides a model for describing Web services .