lib/browse_everything/retriever.rb
# Determines whether or not a remote resource can be retrieved
# @param uri [String] URI for the remote resource (usually a URL)
# @param headers [Hash] any custom headers required to transit the request
Determines whether or not a remote resource can be retrieved
Determines whether or not a remote resource can be retrieved
def can_retrieve?(uri, headers = {})
        request_headers = headers.merge(Range: 'bytes=0-0')
        response = Typhoeus.get(uri, headers: request_headers)
        response.success?
      end
def can_retrieve? ( uri , headers = { } ) request_headers = headers . merge ( Range : 'bytes=0-0' ) response = Typhoeus . get ( uri , headers : request_headers ) response . success? end
Determines whether or not a remote resource can be retrieved
Determines whether or not a remote resource can be retrieved
uri
URI for the remote resource (usually a URL)
URI for the remote resource ( usually a URL )
headers
any custom headers required to transit the request
any custom headers required to transit the request