Trace: » rest.html

[hemmerling] Representational State Transfer ( REST )

Browser Tools

HTTP Protocol clients

Open Data Protocol ( OData )

Tools, SDKs, Libraries

Protocols, Data Formats

  • HTTP protocol.
  • Formats: Atom, JSON or plain XML, including pagination, ordering or filtering of the data.

Data Sources

Facebook Insights

Github API

Google Data API

Windows Azure Data Market

Some other Data Sources

  • SharePoint 2010, Microsoft Dynamics.
  • WebSphere.
  • SAP NetWeaver.

Resources

Software Frameworks for Hosts, based on REST

  • Many application server frameworks support REST for communications.
    • Python host frameworks with REST support: Pyramid, Flask, Bottle,...

Software Frameworks for Clients, based on REST

HATEOAS ( Hypermedia as the Engine of Application State )

OpenAPI / Swagger

The API Swagger

Frameworks

Bravado - Python Library for Swagger 2.0
  • Experts told me in 2016-09, that there is still no support for Swagger 2.0 with the Python application framework “Django” :-(.
  • For calling network functions, the code implementation makes use of Python Decorators.
The old Python Library for Swagger 1.2
Swagger UI
  • Swagger UI - “A dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation and sandbox from a Swagger-compliant API”.

Resources

RAML - RESTful API Modeling Language

Some other Software Frameworks based on REST

Services and Service Concepts based on REST

Use of PATCH

  • REST Experts say: PUT has real-world problems!

Entry point

  • OPTIONS * HTTP/1.1.
  • rel=“service”.

Representations of a resource are distict

  • Also: collections and items.

Use of hypermedia: Links and Relations

  • HTML anchors, XML XLink, Link header.
  • Less “Web 2.0”, more “HTML 2.0”.

Use of ETag

  • Experts advise: Check cacheability with REDbot.

Spec References IANA for Media Types and Relations

  • HTML, AtomPub, hal+json.
  • Standard types where possible, extensible types where not (microformats, RDFa, profile=$URI in HTML4).
  • Standard relations where possible, or else mint your own (IANA).

Client side URI Construction

  • HTML forms, XForms, URI Templates.

Red Pill / blue Pill

  • “s/REST/HTTP/”.
  • or: follow the constraints properly.

Services and Service Concepts not based on REST

Services defined by URIs

Services defined by WADL, SPORE

Custom, in-band authentication

  • Client certificates, X-WSSE.

Web 2.0 company, likely to be featured on Hackerne.ws

  • Comment by a REST expert: “GData is a tragedy”?!

Use of sessions

  • Cookies.
  • Must be able to bookmark a resource.

Services and Service Concepts not based on REST, or not

Lists HTTP status code

  • Depends!!

Collaboration of Software Frameworks with REST Communications

Documentation

REST

Videos

Literature

Open Data Protocol ( OData )

Hardware with REST Software Interface

Best Practices and Awareness with REST

  • You must not implement all REST functions for every REST URI!
  • REST has nothing to do with UI design :-).
  • Design goal:
    • One-time distribution of applications ( think of the Apple / Android / Windows AppStores, where you can´t provide high-frequent updates due to the complicated long-term acceptance process ).
  • Typical Process:
    1. Just provide one single “stable” webservice URL to the application.
    2. The web server returns a Json representation with links.
    3. Let the application find all other links by this representation, using a “Link Discoverer”.
      • Use Link relation instead of “hardcoded links”. Explain these links relations ( “Rels” ) by other URL links, to web pages which explain hwo to deal with the data.
    4. Poll the webservice by checking the HTML ETags for data changes.

Resources

Forums, Newsgroups

Appropriate OpenDirectory Directory Pages

 
en/rest.html.txt · Last modified: 2024/03/17 07:22 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki