I have a rails web application and have to post a json to the host below.
Presently i am struggling.
Can you please help us a with a sample rails controller
method to push this below notification.
net/http is a rather confusing bit of ruby. You may find using a higher level client such as rest client or faraday makes things easier but something like the below should do it
req = Net::HTTP::Post.new(uri)
req.body =‘…’
req.content_type = ‘application.json’
res = Net::HTTP.start(uri.hostname, uri.port) {|http|