code: def on_data(self, data):
          
  
          # Headers have not been read in yet
          if len(self.headers) == 0:
              # forward data to the parser
              data = self.parser.consume(data)
  
              # Headers are finished - build the request and response
              if data is not None:
  
                  # setup the request line attributes
                  self.set_request_line(self.parser.method,
                                        self.parser.parsed_url,
                                        self.parser.version)
  
                  # initialize "content_length" and "body_buffer" attributes
                  self.init_body_buffer(self.method, self.headers)
  
                  # builds request and response out of self.headers and protocol
                  self.req, self.res = self.build_req_and_res()
  
                  # add instruct handler to begin running the application
                  # with the created req and res pairs
                  self._handler.begin_application(self.req, self.res)
  
          # if truthy, 'data' now holds body data
          if data:
              self.validate_and_store_body_data(data)
  
              # if we have reached end of content - put in the request's body
              if len(self.body_buffer) == self.content_length:
                  self.set_body_data(bytes(self.body_buffer))
docs: This is the function called by the handler object upon
          receipt of incoming client data.
          The data is passed to the responder's parser class (via the
          :method:`consume` method), which digests and stores the HTTP
          data.
  
          Upon completion of parsing the HTTP headers, the responder
          creates the request and response objects, and passes them to
          the begin_application method, which starts the parent
          application's middleware chain.
  
          Parameters:
              data (bytes): HTTP data from the socket, expected to be
                  passed directly from the transport/protocol objects.
  
          Raises:
              HTTPErrorBadRequest: If there is a problem parsing headers
                  or body length exceeds expectation.