Error making http request in ruby on rails -
i trying make http request send , sms through kannel using ruby not working,what problem code in method. thanx
require 'net/http' def self.send_sms( to, from, message) id = rand(36**8).to_s(36) uri= uri('http://localhost:13013/cgi-bin/sendsms?') params = {username: 'skylinesms', password: 'password', from: '#{from}', text: '#{message}', 'dlr-url': '#{rails.application.routes.url_helpers.deliver_url(:id => id)}', 'dlr-mask': 3 } uri.query = uri.encode_www_form(params) req = net::http::get.new(uri.to_s) res = net::http.get_response(uri) res end
Comments
Post a Comment