Hydrospheredata / hydro-visualization

Service for visualisation of high dimensional for hydrosphere
3 stars 2 forks source link

HTTP API recommendations #3

Open KineticCookie opened 4 years ago

KineticCookie commented 4 years ago

Hi. REST implies that you manipulate resources using their URLs. But there are major points to consider in current API specification (dev branch):

GET with request body HTTP GET with body breaks idempotency (requesting the same URL multiple times always gets you an equivalent result). Moreover it's rather unexpected.

I'm not sure of the semantics of GET /plottable_embeddings/transformer but consider reimplementation using POST verb. Or if you indeed query the transformer resource use query string.

Verbs in URL In POST /set_params you manipulate params entity — choice of POST verb is good, but URL doesn't describe a resource, but uses a redundant HTTP verb. Consider renaming of url to POST /params.

Feel free to discuss these recommendations 🙂

KineticCookie commented 4 years ago

ping @BeardedWhale