<reponame>anokidev/hasta
'''

    Handling the request data.

    __init__():

        Do nothing.

    __call__():

        Do nothing.

    handle():

        Retrive the request data, and the the data is
        converted into utf-8 string. After that the converted
        string is parsed to seperate all the components of the
        string.

        And then return the processed data.

'''


class Request:

    def __init__(self):

        pass

    def __call__():
        
        pass

    def handle(self, request_data):
        
        self.request_data = request_data

        print("\nREQUEST DATA :\n")

        for line in self.request_data.splitlines():
            print(f"> {line}")

        self.parse()

        return self.request_method, self.path

    def parse(self):

        request_line = self.request_data.splitlines()[0]
        request_line[0].rstrip('\r\n')

        # Break down the request_line into each components.

        self.parsed_request_data = (

            self.request_method,  # GET
            self.path,            # /hello
            self.request_version  # HTTP/1.

        ) = request_line.split()






