Redirection handling in ROKU

496 Views Asked by At

I am trying to call an API in ROKU player using bright script. But I a getting "response code -3". But when I am hitting that service on Web Browser it gives the xml in response. Actually there is a redirection in the API which I am using. As I know the redirection is not handled by the ROKU OS level. So How will I come out this situation. Please help me and provide me any solution for that how can I handle the redirection in ROKU?

Thanks in advance.

3

There are 3 best solutions below

0
On

The documentation at http://sdkdocs.roku.com/display/sdkdoc/roUrlEvent gives CURLE_URL_MALFORMAT as name for the -3 code you got from GetResponseCode() on the roUrlEvent. Try checking the string you get from GetFailureReason() on that same roUrlEvent, which should give a more detailed description of the problem.

0
On

Please check if you are missing any header in http request. Check for accept header also.

0
On

Check this link how to make Get and Post request in Roku.

request = CreateObject("roUrlTransfer")
request.SetUrl("http://blog.roku.com/developer")
html = request.GetToString()