3 ms·
Por que no los dos? You can build a "real" restful API by returning HTML or JSON based on the request's suffix or HTTP-Accept value. Hit it with a web browse
by haroldp 4y ago
Por que no los dos? You can build a "real" restful API by returning HTML or JSON based on the request's suffix or HTTP-Accept value. Hit it with a web browser and get a nice "home page" that says, "This is my very cool API. Here are links to various endpoints. Make your requests with 'Accept: application/json' header, or end the request path in '.json' to get a JSON response". Delightfully discoverable and self-documenting.