ruby - Net::HTTP adding port -


i doing http request need able add port not 80. here code:

response = net::http.get(uri.parse("http://#{@hs_host}/dir/testpage.asp?event=#{cgi::escape(event_name)}")) 

which works perfect when server on port 80. if server on port 85? add :85 after host seems error.

uri = uri.parse(http://#{@hs_host}/dir/testpage.asp?event=#{cgi::escape(event_name)}") uri.port = 8080 

or even:

uri = uri.parse(http://#{@hs_host}:8080/dir/testpage.asp?event=#{cgi::escape(event_name)}") 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -