...

/

Processing of Redirects

Processing of Redirects

Learn to process redirects after getting a REST request.

We'll cover the following...

Redirects

An HTTP redirect is sent from a server to a client in response to a request. In effect, it says, “I’m done processing this request, and you should go here to see the results.” The redirect response includes a URL that the client should try next along with some status information saying whether this redirection is permanent (status code 301 or temporary 307). Redirects are sometimes used when web pages are reorganized, and clients accessing pages in the old locations will be referred to the page’s new home. More commonly, Rails applications use redirects to pass the processing of a request off to some other action.

Redirects are handled behind the scenes by web browsers. Usually, the only way we’ll know that we’ve been redirected is a slight delay and the fact that the URL of the page we’re ...