background preloader


Facebook Twitter

API Anti-Patterns: How to Avoid Common REST Mistakes. Web APIs typically use REST style for communication while moving away from more traditional SOAP web services.

API Anti-Patterns: How to Avoid Common REST Mistakes

Our ProgrammableWeb service directory currently lists around 1500 services which are using REST, and around 360 using SOAP. Why is REST becoming so popular and what are the common mistakes in the REST API design? Graphic from Open APIs: a State of the Market REST API, or to be more precise RESTful API implemented with HTTP, inherently adopts Web architecture principles and can take many advantages of already existing Web technology. Your RESTful API does not require any vendor-specific software. It is not unusual, however, that many APIs that claim to be RESTful actually fail to do so. Some of the most common mistakes that Mike mentions in his presentation: Tunneling everything through GET. REST style conforms to Web architecture design and, if properly implemented, it allows you to take the full advantage of scalable Web infrastructure.

JSON. JSON (/ˈdʒeɪsən/ JAY-sən),[1] or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs.


It is used primarily to transmit data between a server and web application, as an alternative to XML. Although originally derived from the JavaScript scripting language, JSON is a language-independent data format. Code for parsing and generating JSON data is readily available in many programming languages. The JSON format was originally specified by Douglas Crockford. It is currently described by two competing standards, RFC 7159 and ECMA-404. JSON. Restlet - RESTful web framework for Java. 311. Status: Maintenance JCP version in use: 2.7 Java Specification Participation Agreement version in use: 2.0 Description: This JSR will develop an API for providing support for RESTful(Representational State Transfer) Web Services in the Java Platform.


Please direct comments on this JSR to the Spec Lead(s) Updates to the Java Specification Request (JSR) The following information has been updated from the original JSR: Maintenance Lead: Marek Potociar. 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.

Fielding Dissertation: CHAPTER 5: Representational State Transfer (REST)

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. RESTful Web services: The basics. The basics REST defines a set of architectural principles by which you can design Web services that focus on a system's resources, including how resource states are addressed and transferred over HTTP by a wide range of clients written in different languages.

RESTful Web services: The basics

If measured by the number of Web services that use it, REST has emerged in the last few years alone as a predominant Web service design model. In fact, REST has had such a large impact on the Web that it has mostly displaced SOAP- and WSDL-based interface design because it's a considerably simpler style to use. REST didn't attract this much attention when it was first introduced in 2000 by Roy Fielding at the University of California, Irvine, in his academic dissertation, "Architectural Styles and the Design of Network-based Software Architectures," which analyzes a set of software architecture principles that use the Web as a platform for distributed computing (see Resources for a link to this dissertation). Back to top Listing 1. REST APIs must be hypertext-driven » Untangled. I am getting frustrated by the number of people calling any HTTP-based interface a REST API.

REST APIs must be hypertext-driven » Untangled

Today’s example is the SocialSite REST API. That is RPC. It screams RPC. There is so much coupling on display that it should be given an X rating. 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. Protocol Extensibility and Versioning - Dave Orchard's Blog. I've argued for a while now that extensibility and versioning are important topics, and it's incredibly important for data formats to plan for evolvability .

Protocol Extensibility and Versioning - Dave Orchard's Blog

I've already argued that you must have substitution mechanisms in place for V1 , otherwise it's impossible to evolve formats. I've refined my argument that compatibility should be thought of at the the message level, and how to think about synch/asynch compatibility as combinations of compatibility of the messages that make up the message exchange pattern.

But what about protocols? Can we cast the same logic that applies to data formats to protocols? I think we can apply some of the rules for format extensibility to protocols but not as many and the effect isn't as useful as we'd like. I've regularly used the example of a Name containing a first name, then a second version that contains a last name, and then a third version that contains a middle name, when discussion data formats. Restify-versions(7) - REST API Verisioning. Ietf-httpbis-p3-payload-16 - HTTP/1.1, part 3: Message Payload and Content Negotiation. RFC 5988 - Web Linking. [Docs] [txt|pdf] [draft-nottingham-...]

RFC 5988 - Web Linking

[Diff1] [Diff2] [Errata] PROPOSED STANDARD Errata Exist Internet Engineering Task Force (IETF) M. S blog: Web API Versioning Smackdown. Tuesday, 25 October 2011 Filed under: Cloud HTTP Protocol Design A lot of bits have been used over on the OpenStack list recently about versioning the HTTP APIs they provide.

s blog: Web API Versioning Smackdown

This over-long and rambling post summarises my current thoughts on the topic, both as background for that discussion, as well as for review in the wider community. The Warm-up: Software vs. Web Versioning Developers are used to software versioning; e.g., for every release, you bump an identifier. This fine level of granularity is useful to both developers and users; each of these things has precise semantics that helps in figuring out compatibility and debugging. For example, on my Fedora box, I can do: cloud:~> yum -q list installed httpd Installed Packages httpd.x86_64 2.2.17-1.fc14 @updates … and I’ll know that Apache httpd version 2.2.17 is installed, and it’s the first package of that version for Fedora 14. However, they don’t directly apply to versioning on the Web. So what does work, on the Web?