News for hackers. Stuff that matters.
Re:Nobody Understands REST or HTTP by tzaman on Sunday February 26, 2012 @07:04AM (#3635435)
Interesting. But it has one flaw; how exactly would I do this

curl https://api.twilio.com/2010-04-01/Accounts -H "Accept: application/json

inside a browser on a normal GET request?

Re:Nobody Understands REST or HTTP by rue on Sunday February 26, 2012 @07:09AM (#3635446)
The short answer is that browser vendors need to get their act together. They've shirked this because no-one's demanded it.

Fortunately until they do, broadly, a browser user will always want the newest resource, and the type can usually be defaulted (you're using a browser, so you want HTML by default where available). Additionally, XHR and related technologies usually allow adding custom headers.

Re:Nobody Understands REST or HTTP by richardlblair on Sunday February 26, 2012 @04:11PM (#3636802)
One way I have solved this issue is to look for the Accept header. If no valid formatting options are available in the Accept header look for a query string parameter.

To me this is vital. Being able to explore an api within an browser makes it exponentially easier to understand and use.

Re:Nobody Understands REST or HTTP by o1iver on Sunday February 26, 2012 @07:09AM (#3635447)
Why would you want to do that from a browser?
Re:Nobody Understands REST or HTTP by crazygringo on Sunday February 26, 2012 @09:58AM (#3635718)
Ummm... why wouldn't you? Rich web clients and all that?
Re:Nobody Understands REST or HTTP by o1iver on Sunday February 26, 2012 @11:37AM (#3635957)
I thought he meant doing it manually. Using XHR is trivial isn't it?