- 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.
- TD-LTE無線網(wǎng)絡(luò)規(guī)劃與優(yōu)化實務(wù)
- 電子技術(shù)工程訓(xùn)練
- LTE移動通信技術(shù)
- 通信工程綜合實訓(xùn)
- 電子產(chǎn)品調(diào)試技能演練
- 通信專業(yè)實務(wù):交換技術(shù)與網(wǎng)絡(luò)管控
- iOS應(yīng)用軟件設(shè)計之道
- iOS開發(fā):從零基礎(chǔ)到精通
- 電子元器件知識與典型應(yīng)用
- 通信電子電路原理及仿真設(shè)計
- RxJava反應(yīng)式編程
- 物聯(lián)產(chǎn)品電磁兼容分析與設(shè)計
- 高可靠性電子產(chǎn)品工藝設(shè)計及案例分析
- 微信小程序開發(fā)圖解案例教程(附精講視頻)(第2版)
- 對流層散射通信及其應(yīng)用