I'm doing a REST request but when I run I get this error:
NoMethodError: undefined method 'empty?' for #<URI::HTTPS:0x000000063069d8>
My code:
require 'net/http'
require 'uri'
def mandareq
url = URI("https://gateway.plusmms.net/rest/message?")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request.body = {to:[number],text:'teste',from:'Remetente'}
response = http.request(request)
puts response.read_body
end
Any solution?