4 ms·
I feel it best to supplement your REST API with a pure-URI scheme available on _all_ of your resources that is dependent on the request type. You might have bo
by martindale 14y ago
I feel it best to supplement your REST API with a pure-URI scheme available on _all_ of your resources that is dependent on the request type. You might have both;
https://api.test.com/v1/resource https://api.test.com/v1/resource -- standardized API response
https://test.com/resource https://test.com/resource -- "pure" object if JSON is requested, pretty HTML-wrapped version if not.
You can rely on the versioned API to have a specific format and metadata (things like number of results, query times, etc), while the "pure" version is just a raw JSON object.