5 ms·
Interesting. But it has one flaw; how exactly would I do this curl https://api.twilio.com/2010-04-01/Accounts https://api.twilio.com/2010-04-01/Accounts -H "Ac
by tzaman 15y ago
Interesting. But it has one flaw; how exactly would I do this
curl https://api.twilio.com/2010-04-01/Accounts https://api.twilio.com/2010-04-01/Accounts -H "Accept: application/json
inside a browser on a normal GET request?
- rue 15y agoThe 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.
- o1iver 15y agoWhy would you want to do that from a browser?
- crazygringo 15y agoUmmm... why wouldn't you? Rich web clients and all that?
- o1iver 15y agoI thought he meant doing it manually. Using XHR is trivial isn't it?
- richardlblair 15y agoOne 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.