Forum Discussion

sj_dev's avatar
sj_dev
Binge Watcher
5 years ago

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

3 Replies

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

      • speechles's avatar
        speechles
        Roku Guru

        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.