code: def encode_request(request_line, **headers):
      '''Creates the data for a SSDP request.
  
      Args:
          request_line (string): The request line for the request (e.g.
              ``"M-SEARCH * HTTP/1.1"``).
          headers (dict of string -> string): Dictionary of header name - header
              value pairs to present in the request.
  
      Returns:
          bytes: The encoded request.
      '''
      lines = [request_line]
      lines.extend(['%s: %s' % kv for kv in headers.items()])
      return ('\r\n'.join(lines) + '\r\n\r\n').encode('utf-8'f encode_request(request_line, **headers):
      '''Creates the data for a SSDP request.
  
      Args:
          request_line (string): The request line for the request (e.g.
              ``"M-SEARCH * HTTP/1.1"``).
          headers (dict of string -> string): Dictionary of header name - header
              value pairs to present in the request.
  
      Returns:
          bytes: The encoded request.
      '''
      lines = [request_line]
      lines.extend(['%s: %s' % kv for kv in headers.items()])
      return ('\r\n'.join(lines) + '\r\n\r\n').encode('utf-8')
docs: Creates the data for a SSDP request.
  
      Args:
          request_line (string): The request line for the request (e.g.
              ``"M-SEARCH * HTTP/1.1"``).
          headers (dict of string -> string): Dictionary of header name - header
              value pairs to present in the request.
  
      Returns:
          bytes: The encoded request.