On Feb 26, 2013, at 5:38, [email protected] wrote: > On Mon, Feb 25, 2013 at 08:29:48PM -0800, Peter Secor wrote: >> The WUI usually has a pretty good json representation of most screens, just >> tack on a query arg ?t=json to the WUI URL and see what you get. I used to >> use it a lot when running scripts to check node usage but it's also useful >> for scraping other node stats. > > The correct way to do this is to send an "Accept: application/json" header in > the request. Don't change the url to specify the type of return data. The > response should have the same mime type. > > This follows normal REST design patterns.
While it is true that a server should always respect the Accept header, and that programmatic interactions should make use of it, I disagree that a URL parameter is *inappropriate to offer*; the URL parameter is highly useful for debugging/exploration, and from a REST+caps perspective can be seen as an alternate resource (facet) with fewer available representations. That is, the server should support *both* Accept and ?t=, and clients should prefer to use Accept (at least, they should prefer Accept over matching and modifying a URL they receive). -- Kevin Reid <http://switchb.org/kpreid/> _______________________________________________ tahoe-dev mailing list [email protected] https://tahoe-lafs.org/cgi-bin/mailman/listinfo/tahoe-dev
