def parse_http_line(http_line, http_methods):
 http_line_split = http_line.split()
 method = ''
 path = ''
 if (len(http_line_split) > 1):
  method = http_line_split[0]
  path = http_line_split[1]
 if ((method + ' ') not in http_methods):
  method = None
  path = None
 return (method, path)

def parse_http_line ( http_line , http_methods ) : http_line_split = http_line . split ( ) method = '' path = '' if ( len ( http_line_split ) > 1 ) : method = http_line_split [ 0 ] path = http_line_split [ 1 ] if ( ( method + ' ' ) not in http_methods ) : method = None path = None return ( method , path )
parse the header with the http method in it .