Extensions and the World of HTTP
- Published
- about 4 months ago
- by
- with
- 0 Comments
We've now let loose the full power of HTTP in our extension engine.
For a long time we've made it dead easy to pull in content from external resources with HTTP GET requests and integrate them in your templates.
This is great for pulling in a twitter stream or integrating posts from an external RSS feed.
Sometimes however, you need more than just get: setting HTTP headers, using HTTP auth, sending POST, PUT or DELETE requests or just inspecting response headers.
With our latest update to the HTTP library all of that has become possible, with a straightforward API similar to what you're used to from jQuery.
The basic new method is http.request(options), a close cousin of jQuery's $.ajax method.
Since our extensions make HTTP requests synchronously there's no need for callbacks. So the main difference from jQuery is getting back a response object instead of specifying success and error callbacks.
Check out the docs for all the details. We're excited to see what you all come up with now that anything with an HTTP API can be part of your website.