victorCR
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2017
10:41 AM
roURLTransfer Timeout
Hi, I am making a request to an API from a task and the result is I am getting: a -28 as an error code and a message: "Connection timed out after 30005 milliseconds".
I tried making the same request on Postman and it is working fine.
This is my while
I tried making the same request on Postman and it is working fine.
This is my while
While true
msg = wait(0, m.port)
If Type(msg) = "roUrlEvent"
If msg.GetSourceIdentity() = request.GetIdentity()
If msg.GetResponseCode() = 220
response = msg.GetString()
If response.len() <> 0
print ParseJson(response)
m.top.array = ParseJson(response)
Else
printDebug("Feed Failed")
m.top.statusCode = 102
End If
Else
printError(msg)
printDebug("Feed Failed")
m.top.statusCode = msg.GetResponseCode()
End If
End If
End If
End While
5 REPLIES 5
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2017
11:36 AM
Re: roURLTransfer Timeout
How long does the http response really take - is it over 30 seconds?
victorCR
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017
07:53 AM
Re: roURLTransfer Timeout
"RokuNB" wrote:
How long does the http response really take - is it over 30 seconds?
Its way less than that

wburns
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017
11:59 AM
Re: roURLTransfer Timeout
How is your API request structured? It might be a case that other parameters aren't being set, or not being brought into your task.
For example
And the error you're getting back, is it coming from the while loop, or is it a general error that's being returned?
For example
request = CreateObject("roUrlTransfer")
request.SetCertificatesFile("common:/certs/certificate.crt")
request.SetUrl(myUrl)
response = request.GetToString()
And the error you're getting back, is it coming from the while loop, or is it a general error that's being returned?
Will Burns
Developer, REDspace
redspace.com
Developer, REDspace
redspace.com
victorCR
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017
11:42 AM
Re: roURLTransfer Timeout
request = createObject("roUrlTransfer")
printDebug("Making Request to " + m.top.fetchURL)
'Enable this for custom config files'
request.SetCertificatesFile("common:/certs/certificate.crt")
request.EnablePeerVerification(false)
request.SetUrl(m.top.fetchURL)
request.SetMessagePort(m.port)
request.AsyncGetToString()
That's the request I am sending.
Its just a simple GET with no parameters
printDebug("Making Request to " + m.top.fetchURL)
'Enable this for custom config files'
request.SetCertificatesFile("common:/certs/certificate.crt")
request.EnablePeerVerification(false)
request.SetUrl(m.top.fetchURL)
request.SetMessagePort(m.port)
request.AsyncGetToString()
That's the request I am sending.
Its just a simple GET with no parameters
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017
06:11 PM
Re: roURLTransfer Timeout
"victorCR" wrote:
request.AsyncGetToString()
You say you are doing this in a Task, so you can as well use the synchronous .getToString() - if you do that, does it work?
(i am not saying AsyncGetToString() has issues, rather troubleshooting "from simple to complex", step by step)