Skip to content

Instantly share code, notes, and snippets.

@dekart
Created February 8, 2012 06:45
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 dekart/1766176 to your computer and use it in GitHub Desktop.
Save dekart/1766176 to your computer and use it in GitHub Desktop.
class UrlProxy
def initialize(url)
@uri = URI.parse(url)
end
def path
@uri.request_uri
end
def method_missing(m, *args)
@uri.send(m, *args)
end
end
Net::HTTP.post_form(UrlProxy.new('http://thewebsite.net/?foo=bar'), {'postKey'=>'postValue'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment