Ruby/Network/Authentication
Материал из Wiki.crossplatform.ru
(Различия между версиями)
ViGOur (Обсуждение | вклад) м (1 версия: Импорт выборки материалов по Ruby) |
Текущая версия на 18:05, 13 сентября 2010
Basic Authentication
require "net/http" url = URI.parse("http://www.rubyinside.ru/test.txt") Net::HTTP.start(url.host, url.port) do |http| req = Net::HTTP::Get.new(url.path) req.basic_auth("username", "password") puts http.request(req).body end