Created
April 27, 2009 04:34
-
-
Save nahi/102330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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