Hiiiiii,
I am trying to post xml file to https link..
but i get the following error...
undefined method `strip' for []:Array
Please checkout attached jpg for more details..
My Code contents are like this...
#Here is xml contents in @final_xml var
doc.write(@final_xml,2)
#Post url, to which i would like to post the xml file
post_url = "
https://sandbox.doba.com/api/xml_retailer_api.php"
#Headers for xml format
headers["Content-Type"] = "application/atom+xml"
#Post function to pass the url, xml and headers
@post_response = post(post_url,@final_xml,h
eaders)
#Here is the above post function
def post(uri, data, headers)
uri = URI.parse(uri)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
return http.post(uri.path, data, headers)
end
I would greatly appreciate it if someone can shine a light on this subject..
I am new to ruby on rails...
Thanks
Start Free Trial