Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a cascading request module for the browser
JavaScript
branch: master

README.md

curly-js

a request module for browser javascript using cascading syntax
more examples are coming but curly just exposes all the http methods and you config it using cascades.

var curly = require('curly'); // we use a common.js loader in this example

curly.get('/example', callback);
curly.get('/example').send(callback); // above is sugar for this

curly.get('/example')
     .query({hello:'world'}, callback); // adds a query string

curly.get('https://some-json-service.com')
     .query({meh:'bar'})
     .json(callback); // we expect json back

curly.post('/myapp')
     .timeout(2000)
     .json({hello:'world'}, callback); // request must take less than 2s and we send and expect json

curly.jsonp('/myjsonp')
     .query({abe:'fest'}, callback); // jsonp will look for a query with the format name=? to insert the callback.
                                     // If none present it will add callback=?

besides get, post and jsonp curly supports put, and del.

Something went wrong with that request. Please try again.