tinyapi/tools/redirect.py
def redirect(url: str) -> "Respone":
    """
        This function return the repsone object with the given url.

        Parameters
        ----------
        url : `str`
            The url to redirect to.
    """
    html = f"""
        <!DOCTYPE html>
        <html>
            <p>Redirecting...</p>
            <a href="{url}"><p>Click here if you are not redirected</p></a>
        </html>
    """
    resp =  Respone(html, f'301 {STATUS_MESSAGE[301]}','text/html')
    resp.add_header('Location',str(url))
    return resp

        This function return the repsone object with the given url.

        Parameters
        ----------
        url : `str`
            The url to redirect to.
    
This function return the repsone object with the given url.
Parameters

url : `str`
The url to redirect to.
This function return the repsone object with the given url . Parameters url : ` str ` The url to redirect to .
def redirect(url: str) -> "Respone":
    html = f"""
        <!DOCTYPE html>
        <html>
            <p>Redirecting...</p>
            <a href="{url}"><p>Click here if you are not redirected</p></a>
        </html>
    """
    resp =  Respone(html, f'301 {STATUS_MESSAGE[301]}','text/html')
    resp.add_header('Location',str(url))
    return resp
def redirect ( url : str ) -> "Respone" : html = f"""
        <!DOCTYPE html>
        <html>
            <p>Redirecting...</p>
            <a href="{url}"><p>Click here if you are not redirected</p></a>
        </html>
    """ resp = Respone ( html , f'301 {STATUS_MESSAGE[301]}' , 'text/html' ) resp . add_header ( 'Location' , str ( url ) ) return resp
This function return the repsone object with the given url.
This function return the repsone object with the given url .
"""
        This function return the repsone object with the given url.

        Parameters
        ----------
        url : `str`
            The url to redirect to.
    """
url
str