background preloader

Richardson Maturity Model

Richardson Maturity Model
A model (developed by Leonard Richardson) that breaks down the principal elements of a REST approach into three steps. These introduce resources, http verbs, and hypermedia controls. Recently I've been reading drafts of Rest In Practice : a book that a couple of my colleagues have been working on. Their aim is to explain how to use Restful web services to handle many of the integration problems that enterprises face. Figure 1: Steps toward REST To help explain the specific properties of a web-style system, the authors use a model of restful maturity that was developed by Leonard Richardson and explained at a QCon talk. Level 0 The starting point for the model is using HTTP as a transport system for remote interactions, but without using any of the mechanisms of the web. Figure 2: An example interaction at Level 0 Let's assume I want to book an appointment with my doctor. POST /appointmentService HTTP/1.1 [various other headers] <openSlotRequest date = "2010-01-04" doctor = "mjones"/> Related:  HATEOASInteressantesRestFul-ness

REST API Reference Use the Payouts API to make PayPal payments to multiple PayPal accounts in a single API call. You can specify the recipients by using their PayPal email addresses, phone numbers, or encrypted PayPal account numbers. The Payouts API is a fast, convenient way to send commissions, rebates, rewards, and general disbursements. Payouts appear as Mass Payments in the sender's PayPal account and are provided with the Mass Payment reports. For more information about the Payouts API, see Payouts. Important: To use the Payouts API, request access through My Account. The Payouts API uses the ISO 8601 date and time format. Note: Before you can use the Payouts API, learn how to make your first call. 基于 REST 的 Web 服务:基础 基础 REST 定义了一组体系架构原则,您可以根据这些原则设计以系统资源为中心的 Web 服务,包括使用不同语言编写的客户端如何通过 HTTP 处理和传输资源状态。 如果考虑使用它的 Web 服务的数量,REST 近年来已经成为最主要的 Web 服务设计模型。 事实上,REST 对 Web 的影响非常大,由于其使用相当方便,已经普遍地取代了基于 SOAP 和 WSDL 的接口设计。 REST 这个概念于 2000 年由 Roy Fielding 在就读加州大学欧文分校期间在学术论文“Architectural Styles and the Design of Network-based Software Architectures”(请参见参考资料以获取此论文的链接)首次提出,他的论文中对使用 Web 服务作为分布式计算平台的一系列软件体系结构原则进行了分析,而其中提出的 REST 概念并没有获得现在这么多关注。 本文认为,对于今天正在吸引如此多注意力的最纯粹形式的 REST Web 服务,其具体实现应该遵循四个基本设计原则: 显式地使用 HTTP 方法。 下面几个部分将详述这四个原则,并提供技术原理解释,说明为什么这些原则对 REST Web 服务设计人员非常重要。 回页首 显式地使用 HTTP 方法 基于 REST 的 Web 服务的主要特征之一是以遵循 RFC 2616 定义的协议的方式显式使用 HTTP 方法。 REST 要求开发人员显式地使用 HTTP 方法,并且使用方式与协议定义一致。 若要在服务器上创建资源,应该使用 POST 方法。 许多 Web API 中所固有的一个令人遗憾的设计缺陷在于将 HTTP 方法用于非预期用途。 GET /adduser? 这不是非常优雅的设计,因为上面的 Web 方法支持通过 HTTP GET 进行状态更改操作。 除了语义之外,GET 的其他问题在于,为了触发数据库中的记录的删除、修改或添加,或者以某种方式更改服务器端状态,它请求 Web 缓存工具(爬网程序)和搜索引擎简单地通过对某个链接进行爬网处理,从而意外地做出服务器端更改。 清单 1. 清单 2. POST /users HTTP/1.1 Host: myserver Content-Type: application/xml <? 清单 3. 清单 4. 清单 5. 无状态 服务器

Höchster Reifegrad für REST mit HATEOAS | heise Developer Das Erstellen einer sauberen REST-Schnittstelle ist nicht trivial. HATEOAS ermöglicht eine klare Struktur und Aufgabenteilung. HATEOAS ist ein in den letzten Jahren viel diskutiertes Thema: Einige bezeichnen es für REST-Schnittstellen als unverzichtbar. Andere Autoren hängen es etwas tiefer auf und bezeichnen eine HATEOAS-konforme Schnittstelle lediglich als dritten und höchsten Reifegrad von REST. Eine kleine REST-Geschichte Die folgende Geschichte einer REST-Schnittstelle soll sich in einem Unternehmen genau so abgespielt haben. Beispiel-Screenshot für die fiktive Anwendung (Abb. 1) Das Team beschließt, eine REST-Schnittstelle zu entwickeln, und hat die Hoffnung, sie später auch von Apps und IoT-Devices ansprechen zu können. Schematische Darstellung des simplen Service (Abb. 2) Im nächsten Schritt wollen die Entwickler das Anlegen und Bearbeiten von Stationen durch eine Administratorrolle absichern. Der Service mit Administrator Berechtigung (Abb. 3)

ASP.NET - Building Hypermedia Web APIs with ASP.NET Web API Hypermedia—better known as Hypermedia as the Engine of Application State (HATEOAS)—is one of the main constraints of Representational State Transfer (REST). The idea is that hypermedia artifacts, such as links or forms, can be used to describe how clients can interact with a set of HTTP services. This has quickly become an interesting concept for developing evolvable API design. This is not any different from how we usually interact with the Web. We typically remember a single entry point or URL for the homepage of a Web site, and later move through the different sections of the site using links. We also use forms, which come with a predefined action or URL to submit data that the site might need to perform some action. Developers have a tendency to provide static descriptions of all the supported methods in a service, ranging from formal contracts such as Web Services Description Language (WSDL) in SOAP services to simple documentation in non-hypermedia Web APIs. Forms in Action

Swagger: Make Developers Love Working With Your REST API As JAX-RS API is evolving, with version 2.0 released earlier this year under JSR-339 umbrella, it's becoming even more easy to create REST services using excellent Java platform. But with great simplicity comes great responsibility: documenting all these APIs so other developers could quickly understand how to use them. Unfortunately, in this area developers are on their own: the JSR-339doesn't help much. For sure, it would be just awesome to generate verbose and easy to follow documentation from source code, and not asking someone to write it along the development process. Sounds unreal, right? In certain extent, it really is, but help is coming in a form of Swagger. Before digging into implementation details, let's take a quick look what Swagger is from API consumer prospective. lists all people (GET)looks up person by e-mail (GET)adds new person (POST)updates existing person (PUT)and finally removes person (DELETE) Here is the same API from Swagger's perspective: It looks quite pretty.

Fielding Dissertation: CHAPTER 5: Representational State Transfer (REST) [Top] [Prev] [Next] This chapter introduces and elaborates the Representational State Transfer (REST) architectural style for distributed hypermedia systems, describing the software engineering principles guiding REST and the interaction constraints chosen to retain those principles, while contrasting them to the constraints of other architectural styles. REST is a hybrid style derived from several of the network-based architectural styles described in Chapter 3 and combined with additional constraints that define a uniform connector interface. The software architecture framework of Chapter 1 is used to define the architectural elements of REST and examine sample process, connector, and data views of prototypical architectures. 5.1 Deriving REST The design rationale behind the Web architecture can be described by an architectural style consisting of the set of constraints applied to elements within the architecture. 5.1.1 Starting with the Null Style 5.1.2 Client-Server 5.1.3 Stateless

REST APIs must be hypertext-driven » Untangled I am getting frustrated by the number of people calling any HTTP-based interface a REST API. Today’s example is the SocialSite REST API. That is RPC. It screams RPC. What needs to be done to make the REST architectural style clear on the notion that hypertext is a constraint? API designers, please note the following rules before calling your creation a REST API: A REST API should not be dependent on any single communication protocol, though its successful mapping to a given protocol may be dependent on the availability of metadata, choice of methods, etc. There are probably other rules that I am forgetting, but the above are the rules related to the hypertext constraint that are most often violated within so-called REST APIs.

Generating Hypermedia links in ASP.NET Web API - Ben Foster Over the past few weeks I've been developing an API for fabrik, the portfolio and blogging platform I launched last year. This has been a great way to learn both ASP.NET Web API (Microsoft's new way for creating HTTP services) and REST. One design principle of REST, or specifically Hypermedia that I wanted to adhere to was to include links in my resource representations. To quote Wikipedia: RESTful interaction is driven by hypermedia, rather than out-of-band information. This was also necessary as I wanted to support AtomPub which dictates each Atom entry must provide an "edit" link so that clients know how to update entries. So how can we achieve this in ASP.NET Web API, especially as my default response format is JSON, which has no concept of hyperlinks. First I created the following a base class for all my Resource representations: The Link class is an abstract class for defining link relations. With this done, we can now add links to our responses like so: Here's an example response: