dclark61
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2010
08:56 AM
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.
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.
5 REPLIES 5

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2010
04:07 PM
Re: Response code 40x, no headers?
Can you try GetResponseHeadersArray() and report the results?
--Kevin
--Kevin
dclark61
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2010
06:05 AM
Re: Response code 40x, no headers?
Thanks for your reply.
Same results with GetResponseHeadersArray() - 0 elements in the array.
Same results with GetResponseHeadersArray() - 0 elements in the array.
chaochichen
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013
03:43 PM
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?

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2013
05:46 PM
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
chaochichen
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2013
09:52 AM
Re: Response code 40x, no headers?
Cool! RetainBodyOnError() did the trick, thanks.