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: 
sj_dev
Binge Watcher

Avoid automatic url redirect 302

Hi 

I am making a request which automatically redirects to the redirect url on 302 response

 

But for this particular case, want to avoid the redirect and just get the response as 302.

 

How to avoid redirect of the url? Please help me stuck in this for a while

0 Kudos
3 REPLIES 3
speechles
Roku Guru

Re: Avoid automatic url redirect 302

Use Head() or AsyncHead() on the roUrlTransfer object and you shouldn't get redirected.

sj_dev
Binge Watcher

Re: Avoid automatic url redirect 302

@speechles But I want request type to be POST. 

0 Kudos
speechles
Roku Guru

Re: Avoid automatic url redirect 302

Build the request using GET with parameters on it. Put the parameters in the url with the normal &whatever=this routine. You won't be able to use POST and put them in the body. But when you request with Head() or AsyncHead() it should act the same as if you had done a POST request. Give you the same exact answer. You just need to encode the parameters onto the URL leaving them visible. If that is acceptable. Maybe you want to mask the body and not show them on the URL? The Roku is limited in this regard.

0 Kudos