Can someone explain to me the differences between HttpResponse and HttpResponseRedirect?

1

I'm not understanding the differences between HttpResponse and HttpResponseRedirect .

Could someone explain to me?

    
asked by mihael 07.08.2017 в 01:50
source

1 answer

2

The HttpResponseRedirect class is a subclass of HttpResponseRedirect designed to simplify the job of sending a redirect to another web page instead of sending data.

According to the HTTP protocol, there are different response states: HTTP States

  • Status 200 means that everything is fine and sends information to the client (eg web browser) to process it (eg show page).
  • The status 302 means that the page or resource that is being requested is temporarily in another place and sends an address with the new location, the client (web browser) takes that address and goes to it.

In summary:

HttpResponse : It is the class that is responsible for sending information of different types to the client. HttpResponseRedirect : It is a subclass that only serves to send url addresses to those that the client redirects.

    
answered by 07.08.2017 / 04:57
source