Skip to content

Instantly share code, notes, and snippets.

@lisantwi
Last active July 11, 2019 04:32
Show Gist options
  • Save lisantwi/deb883ce549755293a03d8bb2e177937 to your computer and use it in GitHub Desktop.
Save lisantwi/deb883ce549755293a03d8bb2e177937 to your computer and use it in GitHub Desktop.
RESTful API
require 'net/http'
require 'open-uri'
require 'json'
require 'pry'
class GetProducts
URL = "https://makeup-api.herokuapp.com/api/v1/products.json?product_type=eyeshadow"
def get_products
uri = URI.parse(URL)
response = Net::HTTP.get_response(uri)
response.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment