def parse_http_load(full_load, http_methods):
 try:
  (headers, body) = full_load.split('\r\n\r\n', 1)
 except ValueError:
  headers = full_load
  body = ''
 header_lines = headers.split('\r\n')
 http_line = get_http_line(header_lines, http_methods)
 if (not http_line):
  headers = ''
  body = full_load
 header_lines = [line for line in header_lines if (line != http_line)]
 return (http_line, header_lines, body)

def parse_http_load ( full_load , http_methods ) : try : ( headers , body ) = full_load . split ( '\r\n\r\n' , 1 ) except ValueError : headers = full_load body = '' header_lines = headers . split ( '\r\n' ) http_line = get_http_line ( header_lines , http_methods ) if ( not http_line ) : headers = '' body = full_load header_lines = [ line for line in header_lines if ( line != http_line ) ] return ( http_line , header_lines , body )
split the raw load into list of headers and body string .