If a client receives a 301 status code in response to a GET request, what should be the next step in handling the response?

  • Convert the request to a POST request
  • Follow the redirection indicated in the 'Location' header
  • Retry the same GET request
  • Terminate the connection
When a client receives a 301 (Moved Permanently) status code, it means the requested resource has been permanently moved. The correct action is to follow the redirection indicated in the 'Location' header to retrieve the resource from its new location. Retrying the same GET request might result in the same 301 response, leading to an infinite loop. Converting to a POST request or terminating the connection would not be appropriate in this context.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *