It is currently available at olegp/httpclient:1.0 (add that to
manifest.json or via the menus), although Anton is about to move it to
ak/httpclient:1.0 and will probably add its description to the docs.
Anton, please update this thread when you've done it.
More info here: http://wiki.commonjs.org/wiki/HTTP_Client/A
Usage example here:
https://github.com/isaacs/narwhal-playground/blob/master/http-client.js
(note the different module name in require)
Nice thing is that unlike within the browser, the response is
synchronous, so you get the results returned to you. Also, you're not
constrained by the same origin policy, so you can make a request to
any URL (except HTTPS, support for which is on its way).
Oleg
> --
> You received this message because you are subscribed to the Google Groups "akshell" group.
> To post to this group, send email to aks...@googlegroups.com.
> To unsubscribe from this group, send email to akshell+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akshell?hl=en.
>
>
Oleg what happens then if the request times out or something?
--
Body is an array of strings, so you should use JSON.stringify to turn your object into a string.
ValueError: data and post cannot be specified together at new <anonymous> (native init.js:15:13) at Object.ValueError (native init.js:12:26) at Object.requestHost (akshell/ak:0.3:rest.js:510:16) at Object.read (olegp/httpclient:1.0:index.js:123:23) at [object Object].get (main.js:21:22) at [object Object].handle (akshell/ak:0.3:rest.js:132:29) at akshell/ak:0.3:rest.js:211:27 at akshell/ak:0.3:rest.js:471:14 at akshell/ak:0.3:rest.js:451:14 at akshell/ak:0.3:rest.js:439:14 at akshell/ak:0.3:rest.js:392:14 at akshell/ak:0.3:rest.js:249:14 at Object.main (akshell/ak:0.3:rest.js:237:20) at Object.app (akshell/ak:0.3:rest.js:188:41) at default:jsgi.js:91:39
https://github.com/olegp/ak-httpclient/commit/2c66a75a3cd06aaae676ec6deb1633cd8c51e08d