I was exploring Dart, and wanted to create a small project using it to compare it with JavaScript. I was searching for ideas and then I thought of using YQL in Dart, to see how easy or difficult it is.
After poking around a bit, I found that Dart supports making Rest calls using XMLHttpRequest object, similar to JavaScript. I quickly tried to make a YQL call using that object.
The following is the bulk of the code. It is exactly how you do it in plain JavaScript.
URLEncoding
The only place I found a problem, was that Dart doesn’t have a URLEncoder yet. You have to emulate the URLEncoding done in JavaScript. I hope Dart gets its own URLEncoder soon.
Full source code
I have uploaded the full source code to github and added a couple of other examples as well. Check it out.