background preloader

Restful API

Facebook Twitter

Create, read, update and delete. Another variation of CRUD is BREAD, an acronym for "Browse, Read, Edit, Add, Delete".

Create, read, update and delete

HTTP/2 technology demo. JSON-LD. JSON-LD, or JavaScript Object Notation for Linked Data, is a method of transporting Linked Data using JSON.

JSON-LD

It was a goal to require as little effort as possible from developers to transform their existing JSON to JSON-LD.[1] This allows data to be serialized in a way that is similar to traditional JSON.[2] It is a World Wide Web Consortium Recommendation that has been developed by the JSON for Linking Data Community Group before it has been transferred to the RDF Working Group[3] for review, improvement, and standardization.[4] Example[edit] By having all data semantically annotated as in the example, an RDF processor can identify that the document contains information about a person (@type) and if the processor understands the FOAF vocabulary it can determine which properties specify the person’s name and homepage.

Apiary — Home. Building Next-Generation Web APIs with JSON-LD and Hydra. The HTTP OPTIONS method and potential for self-describing RESTful APIs. The OPTIONS method is a somewhat obscure part of the HTTP standard that could be used today with a strong impact on the interconnectedness of the interwebs while requiring minimal effort.

The HTTP OPTIONS method and potential for self-describing RESTful APIs

It's role is well defined in RFC2616, yet no web services that I can find are taking advantage of it. To quote the spec: This method allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval. Hypertext Application Language. Hypertext Application Language (HAL) is an Internet Draft (a "work in progress") standard convention for defining hypermedia such as links to external resources within JSON or XML code.

Hypertext Application Language

The standard was initially proposed on June 2012 specifically for use with JSON[1] and has since become available in two variations, each specific to JSON or XML. The two associated MIME types are media type: application/hal+xml and media type: application/hal+json.[2] HAL was created to be simple to use and easily applicable across different domains by avoiding the need to impose any requirements on how the project be structured. Maintaining this minimal impact approach, HAL has enabled developers to create general-purpose libraries which can be easily incorporated on any API that uses HAL.[1] APIs that adopt HAL are generally more appealing to developers[neutrality is disputed] because it simplifies the use of open source libraries and makes it possible to interact with the API using JSON or XML.

HATEOAS. The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently.

HATEOAS

Details[edit] A REST client enters a REST application through a simple fixed URL. All future actions the client may take are discovered within resource representations returned from the server. The media types used for these representations, and the link relations they may contain, are standardized. The client transitions through application states by selecting from the links within a representation or by manipulating the representation in other ways afforded by its media type. REST API concepts and examples. ProgrammableWeb - APIs, Mashups and the Web as Platform.

Untitled. REST is hot!

untitled

But doing REST right is more difficult than most people think. Idempotent methods, hateoas, RMM levels… All terms that a REST developer should know and master. But from a learning (as I do too, by the way) developer perspective, it looks pretty simple: use HTTP methods like get, post, put and delete, map them onto resources, call the underlying database models and you’re done: a fully RESTfull API in just 5 minutes.

But off course, when you actually have created a RESTfull API, you find out very quickly that nothing could be more difficult. One of the more common problems when dealing with REST might be asynchronous operations. Creating resources. ToDo. RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax. Hypertext Transfer Protocol. This document has been superseded.

Hypertext Transfer Protocol

In 2014, RFC2616 was replaced by multiple RFCs (7230-7237). See IETF Documents for more information. Network Working Group R. Fielding Request for Comments: 2616 UC Irvine Obsoletes: 2068 J. Gettys Category: Standards Track Compaq/W3C J. Status of this Memo This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Copyright Notice Copyright (C) The Internet Society (1999). Abstract. - The RESTful cookbook. RAML - RESTful API modeling language. API Reference - Google Calendar API. Representational state transfer. In computing, representational state transfer (REST) is the software architectural style of the World Wide Web.[1][2][3] More precisely, REST is an architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributed hypermedia system.

Representational state transfer

REST ignores the details of component implementation and protocol syntax in order to focus on the roles of components, the constraints upon their interaction with other components, and their interpretation of significant data elements.[4][1] Through the application of REST architectural constraints certain architectural properties are induced: Performance, Scalability, Simplicity, Modifiability, Visibility, Portability, and Reliability.[4][1] To the extent that systems conform to the constraints of REST they can be called RESTful. History[edit] In a retrospective look at the development of REST Roy Fielding said: