2 ms·
> "On the Web, a resource is a unit of information or service." Does the inclusion of "service" mean it is logical for an API to accept different "actions" as
by dane-pgp 5y ago
> "On the Web, a resource is a unit of information or service."
Does the inclusion of "service" mean it is logical for an API to accept different "actions" as query parameters of the same resource?
AWS has API actions such as "GetMetricData"[0] and the documentation[1] helpfully says:
"CloudWatch does not care which HTTP verb you use in a request. POST requests, GET requests, PUT requests, DELETE requests and so on all return the same result."
[0] https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIRefer...
[1] https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/making-api-requests.html https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIRefer...
- rektide 5y agoMaking each method it's own resource is a kind of interesting challenge. I'd vastly prefer to see individual metric data resources exposed as such- each with their own url- or with range urls- instead of passing a generic DAO endpoint a payload requesting some metrics. But at some point I am sympathetic to the query simply being too verbose to handle. Microsoft's OData was an interesting walking the line act. It was a fairly genuine attempt to make a webful, url-ish way of querying for data. Part of me still thinks it was a great idea part of me thinks it's not in the least different from GetMetricData, even though it's generic, even though it's urlish and rangeful; it's still not passing some sniff tests.