- Building RESTful Web Services with PHP 7
- Haafiz Waheed ud din Ahmad
- 275字
- 2021-07-03 00:02:18
REST versus SOAP
One old alternative to REST is SOAP. In fact, SOAP was already, used when REST came along as an alternative. A key difference is that SOAP doesn't have some particular convention that tells consumers how to access that. SOAP exposes its services using WSDL. Consider WSDL as a definition of services that SOAP provides. This is how the consumer knows what SOAP based web service provides and how to consume them.
On the other hand, REST emphasizes on "conventions over configurations
". If you look at the URL structures and HTTP verbs of RESTful web services as we did earlier, there is a fixed convention. For example, if you are at the client side and want to create a product, if you know what parameters it will take then you can simply create it by sending a POST request to example.com/product and the resource will be created. If you want to list all the products, you can use the same URL with a GET request. If you get product IDs from the List operation, you can simply use them to update or delete a product by using example.com/product/{product_id} using PATCH and PUT or DELETE respectively. It is that simple to know what URL and HTTP method to use to do a type of operation because these are some conventions that RESTful web services follow. So, the one on the client end will just follow those conventions and will not need large documentations for simple tasks.
Other than that, simplicity of statelessness, separation of concerns, and cache-ability are some of the other advantages of RESTful web services that we have already seen in detail.
- VMware View Security Essentials
- 微服務與事件驅動架構
- C語言程序設計基礎與實驗指導
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- UI智能化與前端智能化:工程技術、實現方法與編程思想
- Linux環境編程:從應用到內核
- Mastering Linux Network Administration
- Swift 4 Protocol-Oriented Programming(Third Edition)
- App Inventor創意趣味編程進階
- ASP.NET 4.0 Web程序設計
- Kotlin語言實例精解
- ASP.NET jQuery Cookbook(Second Edition)
- 歐姆龍PLC編程指令與梯形圖快速入門
- 51單片機C語言程序設計經典實例(第3版)
- 網絡工程方案設計與實施(第二版)