Question: I have a json URL supplied by sendgrid. All it needs to be is touched. How would I do this?

```
def suspend
  @user = User.find(params[:id])
  @user.update_attribute("suspended", true)

  # the url I need to touch => https://sendgrid.com/api/unsubscribes.add.xml?api_user=username%40website.com&api_key=secret_password&email=#{@user.email}

end

```

Answer: 
You can use `Net::HTTP.get` from standard library (see [docs](http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html#method-c-get)):

```
require 'net/http'
Net::HTTP.get URI("https://sendgrid.com/api/unsubscribes.add.xml?api_user=username%40website.com&api_key=secret_password&email=#{@user.email}")

```

**Updated:**

For HTTPS you can do smth like that:

```
require "net/https"

uri = URI.parse("https://www.google.com")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(uri.request_uri) 
# request = Net::HTTP::Head.new(uri.request_uri) - get response without body

response = http.request(request)

```

Nice article on the subject - [Ruby Net::HTTP Cheat Sheet](http://www.rubyinside.com/nethttp-cheat-sheet-2940.html).
maybe try `ActionDispatch` GET <http://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-GET>