Skip to content

greenisus/jsonp-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

jsonp-proxy
Mike Mayo <mike@overhrd.com> twitter: @greenisus

Dead simple Sinatra app to make REST API calls and respond in a JSONP style.

Example:

http://localhost:4567/?jsonp=callback&u=https%3A//auth.api.rackspacecloud.com/v1.0

If you included proper headers, you would get something like this back:

callback({ the.response.json });

Request params (all must be URL escaped):

jsonp => callback(response);
u => uri
m => HTTP method (GET, POST, PUT, DELETE, HEAD, etc) default GET
h => request headers hash in json, url encoded
b => request body

Callback argument looks like this:
{ status: 200, headers: { header: hash }, body: 'body text' }

About

A simple Sinatra app to mimic JSONP to any REST API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published