# Form the URL
urlstr = File.join('https://', 'sandbox.ebsco.io', 'pf', 'pfaccount', PROFILE, 'publications')
uri = URI(urlstr)
query = URI.encode_www_form({
# Request parameters
'search' => 'boston',
'offset' => '1',
'count' => '50',
'orderby' => 'relevance',
'searchfield' => 'titlename',
'includefacets' => 'true',
'searchtype' => 'any'
})
if query.length > 0
if uri.query && uri.query.length > 0
uri.query += '&' + query
else
uri.query = query
end
end
# Create the HTTP object
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
# Create the request
request = Net::HTTP::Get.new(uri.request_uri)
request["accept"] = 'application/json'
# Send the request
response = http.request(request)