I am trying to use a code that I used to use with another Mac.
now when I run it with a new Mac (2018) I get the following error
This is the code
require 'net/http'
base = 'www.uniprot.org'
tool = 'uploadlists'
params = {
'from' => 'ACC', 'to' => 'P_REFSEQ_AC', 'format' => 'tab',
'query' => 'P13368 P20806 Q9UM73 P97793 Q17192'
}
http = Net::HTTP.new base
$stderr.puts "Submitting...\n";
response = http.request_post '/' + tool + '/',
params.keys.map {|key| key + '=' + params[key]}.join('&')
loc = nil
while response.code == '302'
loc = response['Location']
response = http.request_get loc
end
while loc
wait = response['Retry-After'] or break
$stderr.puts "Waiting (#{wait})...\n";
sleep wait.to_i
response = http.request_get loc
end
response.value # raises http error if not 2xx
puts response.body
and this is the error I get
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/net/http/response.rb:120:in `error!': 301 "Moved Permanently" (Net::HTTPRetriableError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/net/http/response.rb:129:in `value'
from conver.rb:28:in `<main>'