Skip to content

Instantly share code, notes, and snippets.

@billyyarosh
Created December 9, 2021 04:40
Show Gist options
  • Save billyyarosh/5ff2102ae1a9ece7369fbc68f24883fd to your computer and use it in GitHub Desktop.
Save billyyarosh/5ff2102ae1a9ece7369fbc68f24883fd to your computer and use it in GitHub Desktop.
Song Gateway Service Class
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