Created
July 31, 2010 17:29
-
-
Save henryhamon/502403 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
# Realiza um PUT no servidor | |
def self.put(uri, content = {}) | |
url = URI.parse(uri) | |
req = Net::HTTP::Put.new(uri) | |
req.basic_auth APP_CONFIG['email'], APP_CONFIG['password'] | |
Net::HTTP.start(url.host, url.port) do |http| | |
req['Content-Type'] = 'text/plain; charset=utf-8' | |
req.set_form_data(content) unless content == {} | |
http.request(req) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment