Skip to content

Commit

Permalink
some tweaks
Browse files Browse the repository at this point in the history
primarily to correct the POST example for creating a new document
  • Loading branch information
tkimnguyen committed Jun 6, 2017
1 parent 194df17 commit ff3cb30
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.rst
Expand Up @@ -26,9 +26,9 @@ RESTful Hypermedia API

REST stands for `Representational State Transfer <http://en.wikipedia.org/wiki/Representational_state_transfer>`_. It is a software architectural principle to create loosely coupled web APIs.

Most web APIs have a tight coupling between client and server. This makes them brittle and hard to change over time. It requires them not only to fully document every small detail of the API, but also write a client implementation that follows that specification 100% and breaks as soon as you change any detail.
Most web APIs have a tight coupling between client and server. This makes them brittle and hard to change over time. It requires them not only to fully document every small detail of the API, but also to write a client implementation that follows that specification 100% correctly and breaks as soon as you change any detail.

A hypermedia API just provides an entry point to the API that contains hyperlinks the clients can follow. Just like a human user of a regular website, that knows the initial URL of a website and then follows hyperlinks to navigate through the site. This has the advantage that the client just needs to understand how to detect and follow links. The URL and other details of the API can change without breaking the client.
A hypermedia API just provides an entry point to the API that contains hyperlinks the clients can follow, just as a human user of a regular website knows the initial URL of the site and then follows hyperlinks to navigate through the site. This has the advantage that the client needs to understand only how to detect and follow links. The URL and other details of the API can change without breaking the client.


Documentation
Expand Down Expand Up @@ -56,25 +56,25 @@ Example GET request on the portal root::

Example POST request to create a new document::

$ curl -i -X POST http://plonedemo.kitconcept.com -H "Accept: application/json" -H "ontent-Type: application/json" --data-raw '{"@type": "Document", "title": "My Document"}' --user admin:admin
$ curl -i -X POST http://plonedemo.kitconcept.com -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"@type": "Document", "title": "My Document"}' --user admin:admin

.. note:: You will need some kind of API browser application to explore the API. We recommend to use `Postman <http://www.getpostman.com/>`_.
.. note:: You will need some kind of API browser application to explore the API. We recommend using `Postman <http://www.getpostman.com/>`_.


Design Decisions
================

* A truly RESTful API (Hypermedia / HATEOAS / Linked-data)
* JSON is the main target format, support other formats (HTML, XML) later
* JSON is the main target format; support for other formats (HTML, XML) will come later
* Use HTTP headers (to set format and versioning, also provide URL-based option to make it easier for people to try it out)
* No versioning, version in the HTTP header can be added later
* No versioning; versioning in the HTTP header can be added later
* Field names just map over (we will not try to clean up attributes or enforce naming standards like pep8 (e.g. isPrincipiaFoldish -> is_folderish)


Software Quality
================

* 100% Test Coverage
* 100% test coverage
* 100% PEP8 compliant
* Documentation-first approach for enhancements

Expand Down

0 comments on commit ff3cb30

Please sign in to comment.