filmov
tv
Flask Redirect and Errors
Показать описание
Flask Redirect and Errors
Flask Redirect and Errors
Flask class provides the redirect() function which redirects the user to some specified URL with the specified status code.
An HTTP status code is a response from the server to the request of the browser. When we visit a website, a request is sent to the server, and the server then responds to the browser's request with a three-digit code: the HTTP status code. This status code also represents the error.
The syntax to use the redirect() function is given below.
The abort() function
the following error codes depending upon the specified errors.
400: for bad requests
401: for unauthorized access
403: for forbidden
404: for not found
406: for not acceptable
415: for unsupported media types
429: for too many requests
Flask Redirect and Errors
Flask class provides the redirect() function which redirects the user to some specified URL with the specified status code.
An HTTP status code is a response from the server to the request of the browser. When we visit a website, a request is sent to the server, and the server then responds to the browser's request with a three-digit code: the HTTP status code. This status code also represents the error.
The syntax to use the redirect() function is given below.
The abort() function
the following error codes depending upon the specified errors.
400: for bad requests
401: for unauthorized access
403: for forbidden
404: for not found
406: for not acceptable
415: for unsupported media types
429: for too many requests