# File lib/gist.rb, line 305 def shorten(url) request = Net::HTTP::Post.new("/create") request.set_form_data(:url => url) response = http(GIT_IO_URL, request) case response.code when "200" URI.join(GIT_IO_URL, response.body).to_s when "201" response['Location'] else url end end