-
Notifications
You must be signed in to change notification settings - Fork 13
RESTful Service Guide
Alexander edited this page Aug 25, 2016
·
10 revisions
We had some inconsistencys and open questions related to RESTful API design, which lead to ugly request URLs. This is why we define some basic guidelines here. The interested reader may continue his studies in this paper where some of these information were extracted from, and this book referenced from the paper.
NOTE: This is WIP, any contribution is welcome!
TODO: Short introduction to main REST principles:
- Resources
- Actions
- Methods
- Statelessness
- Loose coupling
- ...
Criteria 1-12 are highly relevant while criteria 13-17 are related, but not highly relevant.
- Availability of Formal Description. TODO: Do we have this? Can we use Swagger for this?
- Links in Representations. Links to other resources are navigational help and provide follow-up actions. It allows a loose coupling between client and API since the client gets an URL where he can proceed. However, this is not possible in las2peer (yet?) since the service never knows the used endpoint (WebConnector) where he actually runs, so a service can only provide a relative link.
- Forms in Representations.
- Number of Resource Types.
- Versioned service endpoint. TODO: We will have an versioned service endpoint. Is this bad or not?
- Scoping Information
- Parameter Sources
- Meaningful HTTP Status Codes. Enhance error handling by sending reasonable HTTP status codes.
- HTTP Methods Used. Using just a single method can also point to an overloading of functionality.
- HTTP Method Override. Some browsers only accept only GET and POST.
- Representation Formats. Commonly used formats are XML, JSON, serialized PHP, ATOM, HTML and CSV
- Representation Format Selection. HTTP allows the user to specify the media type. Most common way is to pass the format as an argument.
- User Authentication. HTTP provides a general mechanism, including specific authentication protocols to be used. Other standards such as the OAuth protocol have emerged.
- Secure Connections. Support SSL-secured connections.
- Accessibility via other protocols.
- Type of Registration Required. Provide a registration method like API-Keys.
- Usage Limitations. For example allow only a certain amount of requests during a fixed time.
Copyright (c) 2020 Advanced Community Information Systems (ACIS) Group, Chair of Computer Science 5 (Databases & Information Systems), RWTH Aachen University, Germany