Created
December 9, 2021 04:40
-
-
Save billyyarosh/5ff2102ae1a9ece7369fbc68f24883fd to your computer and use it in GitHub Desktop.
Song Gateway Service Class
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
class SongGatewayService | |
def create_song(song_json) | |
uri = URI('https://music.com/songs') | |
res = Net::HTTP.post(uri, song_json.to_json) | |
unless res.is_a?(Net::HTTPSuccess) | |
nil | |
end | |
res.body | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment