Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jedashford
Channel Surfer

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 2

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
Channel Surfer

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