Skip to content

Instantly share code, notes, and snippets.

@spurton
Created February 11, 2009 00:40
Show Gist options
  • Save spurton/61727 to your computer and use it in GitHub Desktop.
Save spurton/61727 to your computer and use it in GitHub Desktop.
Net::HTTP.start(@uri.host, @uri.port) do |http|
request = Net::HTTP::Post.new(@uri.to_s, {'Content-type => 'whatever'})
request.basic_auth(@uri.user, @uri.password) if @uri.user && @uri.password
result = http.request(request, data)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment