roUrlEvent returns "??" as body with 200 status code
I'm trying to fetch some JSON data from my server but about 60% of the time the roURLEvent returns "??" as the body of the request. The other 40% of the times it works as expected (the content response hasn't changed).
The code for the request is the following
baseurl = m.top.url
token = m.top.token
url = baseurl + "/some_endpoint"
? "Task URL: ";url
? "Token: "; token
http = createObject("roUrlTransfer")
port = createObject("roMessagePort")
if http.AsyncGetToString() Then
msg = wait(100000, port)
if (type(msg) = "roUrlEvent")
if (msg.getresponsecode() > 0 and msg.getresponsecode() < 400)
print "Task Response "
In the debugger I print the msg headers and everything seems to be ok
But everytime I print the msg.getString(), or just msg, I get "??" on the console. Also I'm pretty positive the backend is working as expected since I have 2 mobile apps running on the same server without any issues, I also double checked the url and it's the right one (since it works 40% of the time)
I'm really lost here since I don't see what could be going on. Maybe it's has to be with the encoding? but it works 40% of time so it doesn't make sense. I'm also running 2 other queries to the same server at the same time, which work mostly without issue (one of the other queries fails with the same error but only about 10% of the time)