Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
urlloader attempt to call a table value — Gideros Forum

urlloader attempt to call a table value

piepie Member
edited May 2023 in General questions
Hi I was trying to get some feedback from my users through the rest API of firebase using urlloader via POST method, but I get this "attempt to call a table value" error which I am not sure to what refers to:
it happens inside the pcall, so I guess it's raised by UrlLoader.new, but looking at the examples I would say it should work (there might be other errors in how I try to update firebase db :# , but I think I should get a pcall success if the urlLoader is intialized correctly):

My code looks like this:
				local data = { keyone = "banana", keytwo ="apple" }
				local jdata = json.encode(data)
				local url= "https:.....firebasedatabase.app"
				local headers = {
							["Content-Type"] = "application/json",
				local ok, result = pcall( UrlLoader.new(url, UrlLoader.POST, headers, jdata) )
				print("PCALL", ok, result)
				if ok then
					result:addEventListener(Event.COMPLETE, function(e)
					result:addEventListener(Event.ERROR, function()
					print("SUCCESS", ok)
					print("NO SUCCESS",ok, result)
and it returns
PCALL	nil	attempt to call a table value
Anything you can see I am doing wrong? Thank you

[edit. gideros tries to href the url, so I cut it ]


Sign In or Register to comment.