SollmoStudio/beyond — pull request #139 by noraesae (2014-10-03 21:23:31+00:00)
Title: Add ScriptableHttp.

ScriptableHttp is the module to send HTTP request from the Beyond
plugin. Basically, it's the thin wrapper for Play's WS API.

Surely I'll update the Wiki later, but now I'll share the basic usage here.

```javascript
var http = require('http');
var req = http('http://www.naver.com');
req = req.withHeaders({'hello': 'world'});
req = req.withJSON({'hello': 'world'}); // Set JSON body
req = req.withForm({'hello': 'world'}); // Set form body
req = req.withQueryString({'hello': 'world'}); // Set query string, which could be done with URL
var future = req.get(); // Also support `put`, `head`, `put`, `delete`, `options`, `patch`
future.onSuccess(function (res) {
console.log(res.status); // Int
console.log(res.statusText); // String
console.log(res.body); // body text: String
console.log(JSON.stringify(res.headers)); // headers as object
});
```