code: def dump_http(method, url, request_headers, response, output_stream):
      
  
      # Start header.
      output_stream.write('---------START-HTTP---------\n')
  
      # Get parsed url.
      parsed_url = urlsplit(url)
  
      # Dump all request headers recursively.
      http_path = parsed_url.path
      if parsed_url.query:
          http_path = http_path + '?' + parsed_url.query
  
      output_stream.write('{0} {1} HTTP/1.1\n'.format(method,
                                                      http_path))
  
      for k, v in list(request_headers.items()):
          if k is 'authorization':
              # Redact signature header value from trace logs.
              v = re.sub(r'Signature=([[0-9a-f]+)', 'Signature=*REDACTED*', v)
          output_stream.write('{0}: {1}\n'.format(k.title(), v))
  
      # Write a new line.
      output_stream.write('\n')
  
      # Write response status code.
      output_stream.write('HTTP/1.1 {0}\n'.format(response.status))
  
      # Dump all response headers recursively.
      for k, v in list(response.getheaders().items()):
          output_stream.write('{0}: {1}\n'.format(k.title(), v))
  
      # For all errors write all the available response body.
      if response.status != 200 and \
         response.status != 204 and response.status != 206:
          output_stream.write('{0}'.format(response.read()))
  
      # End header.
      output_stream.write('---------END-HTTP---------\n')
docs: Dump all headers and response headers into output_stream.
  
      :param request_headers: Dictionary of HTTP request headers.
      :param response_headers: Dictionary of HTTP response headers.
      :param output_stream: Stream where the request is being dumped at.