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: 
dclark61
Visitor

Response code 40x, no headers?

Hello, new developer here.

GetResponseCode returns 401, but GetResponseHeaders returns nothing. I know that my server is sending back response headers. I've also seen this with code 403. Codes 200 and 500 work as expected (I get headers). Any ideas?

Thanks in advance.
0 Kudos
5 REPLIES 5
RokuKevin
Visitor

Re: Response code 40x, no headers?

Can you try GetResponseHeadersArray() and report the results?

--Kevin
0 Kudos
dclark61
Visitor

Re: Response code 40x, no headers?

Thanks for your reply.

Same results with GetResponseHeadersArray() - 0 elements in the array.
0 Kudos
chaochichen
Visitor

Re: Response code 40x, no headers?

According to the online SDK doc at http://sdkdocs.roku.com/display/sdkdoc/roUrlEvent, "...All headers are returned regardless of the status code". I am getting zero headers from GetResponseHeadersArray() when response code is 40x on my Roku 3 with firmware version 5.0 build 8045. This function only works when response code is 200. So, it looks like Roku has never fixed the GetResponseHeadersArray() bug since 2010?
0 Kudos
TheEndless
Channel Surfer

Re: Response code 40x, no headers?

"chaochichen" wrote:
According to the online SDK doc at http://sdkdocs.roku.com/display/sdkdoc/roUrlEvent, "...All headers are returned regardless of the status code". I am getting zero headers from GetResponseHeadersArray() when response code is 40x on my Roku 3 with firmware version 5.0 build 8045. This function only works when response code is 200. So, it looks like Roku has never fixed the GetResponseHeadersArray() bug since 2010?

If your channel is only intended to run on Roku 2 and 3 devices, you can use the RetainBodyOnError method of the roUrlTransfer object.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
chaochichen
Visitor

Re: Response code 40x, no headers?

Cool! RetainBodyOnError() did the trick, thanks.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.