Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simonbengtsson/ajaxbridge

See it in action
https://github.com/simonbengtsson/ajaxbridge

Last synced: about 1 month ago
JSON representation

See it in action

Awesome Lists containing this project

README

        

## Ajax Bridge
The purpose of AjaxBridge is to act as a proxy to circumvent the cross origin policy. It enables any javascript
to send any request to any server and get the complete response back, including cookie headers.

### Usage
This example fetches the html of the twitter homepage. The only required option is url`.

var options = {
url: 'https://twitter.com/',
method: 'GET',
headers: {
'User-Agent': 'AjaxBridge',
'Other-Header': 'Value'
},
content: ''
};

$.post('https://ajax-bridge.appspot.com', options, function (res) {
console.log(res); // See example response below
});

{
"protocol": "HTTP/1.1",
"status": 200,
"statusText": "OK",
"headers": {
"cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0",
"content-security-policy-report-only": "default-src https:; connect-src https:; font-src https",
"content-type": "text/html;charset=utf-8",
"date": "Fri, 17 Oct 2014 18:16:10 UTC",
"expires": "Tue, 31 Mar 1981 05:00:00 GMT",
"last-modified": "Fri, 17 Oct 2014 18:16:10 GMT",
"ms": "S",
"pragma": "no-cache",
"server": "tsa_a",
"set-cookie": "guest_id=v1%3A141356977060427045; Domain=.twitter.com; Path=/; Expires=Sun, 16-Oct-2016 18:16:10 UTC",
"status": "200 OK",
"strict-transport-security": "max-age=631138519",
"x-connection-hash": "e43d6d1abaacfa287738a7a17f329665",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-transaction": "a1413ba660e67325",
"x-ua-compatible": "IE=edge,chrome=1",
"x-xss-protection": "1; mode=block",
"X-Google-Cache-Control": "remote-fetch",
"Via": "HTTP/1.1 GWA"
},
"content": "\n