Esempio n. 1
0
def print_http_response(response_headers, code, page):
    if settings.VERBOSITY_LEVEL >= 3:
        resp_msg = "HTTP response (" + str(code) + "):"
        print(settings.print_response_msg(resp_msg))
        http_response(response_headers, code)
    if settings.VERBOSITY_LEVEL >= 4:
        print("")
        http_response_content(page)
Esempio n. 2
0
def print_http_response(response_headers, code, page):
  if settings.VERBOSITY_LEVEL >= 3:
    resp_msg = "HTTP response [" + settings.print_request_num(settings.TOTAL_OF_REQUESTS) + "] (" + str(code) + "):"
    print(settings.print_response_msg(resp_msg))
    http_response(response_headers, code)
  if settings.VERBOSITY_LEVEL >= 4:
    print("")
    http_response_content(page.decode())
Esempio n. 3
0
def print_http_response(response_headers, code, page):
  if settings.VERBOSITY_LEVEL >= 3 or menu.options.traffic_file:
    if settings.VERBOSITY_LEVEL >= 3:
      resp_msg = "HTTP response [" + settings.print_request_num(settings.TOTAL_OF_REQUESTS) + "] (" + str(code) + "):"
      print(settings.print_response_msg(resp_msg))
    if menu.options.traffic_file:
      resp_msg = "HTTP response [#" + str(settings.TOTAL_OF_REQUESTS) + "] (" + str(code) + "):"
      logs.log_traffic("\n" + resp_msg)
    http_response(response_headers, code)
  if settings.VERBOSITY_LEVEL >= 4 or menu.options.traffic_file:
    if settings.VERBOSITY_LEVEL >= 4:
      print(settings.SPACE)
    try:
      http_response_content(page)
    except AttributeError:
      http_response_content(page.decode(settings.UNICODE_ENCODING))