Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jedashford
Level 7

roUrlEvent 40x Body Responses missing

I'm in the process of updating our Roku Channel with a new API backend. When we respond with a 40x which includes JSON, I'm unable to get the body of the response.

In the documentation, it indicates headers are only returned on 20x responses. Does this also mean the response body is not accessible from 40x responses? I tried all I could to get the body using event.GetString(), but always returns an empty string on 40x response codes. Any ideas?

http://sdkdocs.roku.com/display/sdkdoc/roUrlEvent - indicates "Headers are only returned when the status code is greater than or equal to 200 and less than 300.", but this information isn't offered for event.GetString()
0 Kudos
2 Replies

Re: roUrlEvent 40x Body Responses missing

roUrlTransfer's RetainBodyOnError function from http://sdkdocs.roku.com/display/sdkdoc/ifUrlTransfer will most likely solve your problem.
0 Kudos
jedashford
Level 7

Re: roUrlEvent 40x Body Responses missing

"siekermantechnology" wrote:
roUrlTransfer's RetainBodyOnError function from http://sdkdocs.roku.com/display/sdkdoc/ifUrlTransfer will most likely solve your problem.


Works like a charm, thank you!
0 Kudos