Complete the code to send a 301 redirect response in a REST API.
response.status_code = [1]HTTP status code 301 means the resource has been permanently moved to a new URL.
Complete the code to send a 302 redirect response in a REST API.
response.status_code = [1]HTTP status code 302 means the resource has been temporarily moved to a different URL.
Fix the error in setting the redirect status code to 301 in this REST API code.
response.status_code = [1]The correct status code for permanent redirect is 301, not 302 or others.
Fill both blanks to set a 302 redirect with the correct Location header.
response.status_code = [1] response.headers['Location'] = [2]
302 status code is for temporary redirect and Location header tells where to redirect.
Fill all three blanks to set a 301 redirect with a Location header and a message body.
response.status_code = [1] response.headers['Location'] = [2] response.body = [3]
301 is permanent redirect, Location header points to new URL, and body can explain the redirect.