Skip to content

Instantly share code, notes, and snippets.

@coryf
Created July 20, 2012 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coryf/3150898 to your computer and use it in GitHub Desktop.
Save coryf/3150898 to your computer and use it in GitHub Desktop.
Sinatra POST/GET Proxy using RestClient
# POST proxy
post '/api/*' do
splat = params.delete('splat')
RestClient.post "http://#{@dest_host_port}/#{splat}", params
end
# GET proxy
get '/api/*' do
splat = params.delete('splat')
RestClient.get "http://#{@dest_host_port}/#{splat}", :params => params
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment