官术网_书友最值得收藏!

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:

73% of the APIs on Programmable Web use REST. SOAP is far behind but is still represented in 17% of the APIs.

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.

主站蜘蛛池模板: 张北县| 汽车| 嵊泗县| 潞西市| 南溪县| 城口县| 浙江省| 二手房| 屏山县| 大港区| 和静县| 射阳县| 东乡族自治县| 清徐县| 米易县| 青州市| 阿克苏市| 苍山县| 酉阳| 芦溪县| 大港区| 滁州市| 沾益县| 金湖县| 临潭县| 临城县| 石首市| 井研县| 德令哈市| 垫江县| 洪湖市| 岑溪市| 图木舒克市| 汝阳县| 安国市| 牡丹江市| 扶沟县| 自治县| 张家川| 白朗县| 九寨沟县|