Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Created February 20, 2010 13:30
Show Gist options
  • Save oberhamsi/309682 to your computer and use it in GitHub Desktop.
Save oberhamsi/309682 to your computer and use it in GitHub Desktop.
var client = require('ringo/httpclient')
var options = {
// exchange
'data': {},
'headers': {},
'method': 'GET',
'contentType': 'application/x-www-form-urlencoded;charset=utf-8',
'username': '',
'password': '',
'proxy': 'x.x.x.x:8888'
'proxyCredentials': {'username': '', 'password: ''},
// exchange callbacks
'success': function(content, status, contentType, exchange),
'complete': function(content, status, contentType, exchange)
'part': function(contentPart, status, contentType, exchange),
'error': function(exception, exchange),
// client
'async': true,
'cache': true,
'timeout': 1000,
'followRedirects': true,
});
client.do(options) // "do" as name not possible
// shortcut functions
* client.doGet(url, data, success, error)
* client.doPost(url, data, success, error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment