title: 405 Method not allowed on Net::HTTP request [ruby on rails]
body: <p>I'm trying to verify if there is a remote url with following code:</p>
  
  <pre><code>endpoint_uri = URI.parse(@endpoint.url)
  endpoint_http = Net::HTTP.new(endpoint_uri.host, endpoint_uri.port)
  endpoint_request = Net::HTTP::Head.new(endpoint_uri.request_uri)
  endpoint_response = endpoint_http.request(endpoint_request)
  </code></pre>
  
  <p>I'm still getting 405 Method not allowed. When I use <code>Get</code> instead <code>Head</code> in <code>Net::HTTP::Head.new</code> I'm getting 200 Success but also with whole remote document in response what results in bigger response time (0.3s => 0.9s).</p>
  
  <p>Any ideas why this is happening? Thx</p>