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

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.

主站蜘蛛池模板: 玉溪市| 昆山市| 石河子市| 昌宁县| 班戈县| 溧水县| 蓝田县| 若尔盖县| 京山县| 德惠市| 莫力| 临湘市| 穆棱市| 陇川县| 乌兰浩特市| 扬州市| 错那县| 扎赉特旗| 普兰县| 涿鹿县| 彰化县| 韶山市| 甘德县| 龙海市| 洱源县| 黄大仙区| 襄樊市| 永安市| 兴业县| 彭阳县| 昌宁县| 大姚县| 正安县| 灵武市| 永胜县| 洪泽县| 甘南县| 桐城市| 华安县| 深水埗区| 灵寿县|