Skip to content

Instantly share code, notes, and snippets.

@nahi
Created April 27, 2009 04:34
Show Gist options
  • Save nahi/102330 to your computer and use it in GitHub Desktop.
Save nahi/102330 to your computer and use it in GitHub Desktop.
require "httpclient"
module Net
class HTTP < Protocol
class << HTTP
def get(uri_or_host, path = nil, port = nil)
raise if path or port
HTTPClient.get_content(uri_or_host)
end
Response = Struct.new(:body)
def post_form(url, params)
result = HTTPClient.post_content(url, params)
Response.new(result)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment