- Cloud-Native Applications in Java
- Ajay Mahajan Munish Kumar Gupta Shyam Sundar
- 411字
- 2021-06-24 19:07:19
The trio – REST, HTTP, and JSON
The web has made HTTP tremendously popular and is the de facto integration mechanism for accessing content on the internet. Interestingly, this technology was not hugely popular within applications that relied on native and binary protocols, such as RMI and CORBA for inter-application access.
When social consumer companies, such as Google, Amazon, Facebook, and Twitter, started publishing APIs to connect/integrate with their products, the de facto standard for integration across the web became HTTP/REST. Social consumer companies started investing in platforms for onboard developers to develop various applications leading to the proliferation of applications that relied on HTTP as the protocol.
The applications on the browser side are a mix of HTML and JavaScript. Information returned from the server or across other applications needs to be in a simple and usable format. JavaScript supports data manipulation, and the data format that it suited most is JavaScript Object Notation (JSON).
REST is a state representational style that provides a way to deal with interchange over HTTP. REST has a lot factors in its favor:
- Utilizes the HTTP protocol standard, giving it an immense leg up for anything and everything on WWW
- Mechanism to isolate the access to entities (GET/PUT/POST/DELETE) while still utilizing the same HTTP request model
- Supports JSON as the data format
REST with JSON has become the dominant model over the SOAP/XML model. According to one statistic from ProgrammableWeb:
Let's cover some high-level reasons why the REST/JSON model is favored over the SOAP/XML model of service development:
- SOAP model of contract first approach makes crafting web services difficult.
- SOAP is complex compared to REST, giving a steeper learning curve as compared to REST.
- REST is lightweight compared to SOAP and does not tax the bandwidth as much as SOAP.
- Support for SOAP outside of the Java world is limited, relegating SOAP primarily to the enterprise world.
- XML parsing on the client side is memory and compute intensive, which does not lend well to the mobile world.
- XML Schema/markup provides structure definitions and validation models but at the expense of additional parsing. JSON has a loose syntax allowing rapid iterations on the data model.
Today, the reality is REST/JSON has been adopted as the standard for integration across programming languages providing an easy and simple way to integrate APIs over the internet.
- 電子技術(shù)綜合知識全精講(雙色版)
- 室內(nèi)分布系統(tǒng)規(guī)劃設(shè)計(jì)手冊
- 5G技術(shù)核心與增強(qiáng):從R15到R16
- 應(yīng)急通信指揮
- Android板級支持與硬件相關(guān)子系統(tǒng)
- 5G技術(shù)與應(yīng)用
- 現(xiàn)代交換技術(shù)實(shí)用教程
- 目標(biāo)特性與傳感原理
- 現(xiàn)代電子產(chǎn)品工藝
- 移動(dòng)通信技術(shù)與應(yīng)用(第2版)
- Microduino實(shí)戰(zhàn)
- 電子技術(shù)及應(yīng)用(第2版)
- LED照明設(shè)計(jì)與案例精選
- 跳頻通信自適應(yīng)抗干擾技術(shù)
- Arm Helium技術(shù)指南:Cortex-M系列處理器的矢量運(yùn)算擴(kuò)展