Last active
July 11, 2019 04:32
-
-
Save lisantwi/deb883ce549755293a03d8bb2e177937 to your computer and use it in GitHub Desktop.
RESTful API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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