MCPcopy
hub / github.com/tornadoweb/tornado / get

Method get

tornado/test/web_test.py:576–599  ·  view source on GitHub ↗
(self, *path_args)

Source from the content-addressed store, hash-verified

574
575class EchoHandler(RequestHandler):
576 def get(self, *path_args):
577 # Type checks: web.py interfaces convert argument values to
578 # unicode strings (by default, but see also decode_argument).
579 # In httpserver.py (i.e. self.request.arguments), they're left
580 # as bytes. Keys are always native strings.
581 for key in self.request.arguments:
582 if type(key) is not str:
583 raise Exception("incorrect type for key: %r" % type(key))
584 for bvalue in self.request.arguments[key]:
585 if type(bvalue) is not bytes:
586 raise Exception("incorrect type for value: %r" % type(bvalue))
587 for svalue in self.get_arguments(key):
588 if type(svalue) is not unicode_type:
589 raise Exception("incorrect type for value: %r" % type(svalue))
590 for arg in path_args:
591 if type(arg) is not unicode_type:
592 raise Exception("incorrect type for path arg: %r" % type(arg))
593 self.write(
594 dict(
595 path=self.request.path,
596 path_args=path_args,
597 args=recursive_unicode(self.request.arguments),
598 )
599 )
600
601
602class RequestEncodingTest(WebTestCase):

Callers 15

do_test_connectMethod · 0.45
set_environFunction · 0.45
get_and_discardMethod · 0.45
workerMethod · 0.45
test_task_done_delayMethod · 0.45
test_orderMethod · 0.45
test_orderMethod · 0.45
consumerMethod · 0.45
test_csvMethod · 0.45
test_csv_bomMethod · 0.45
test_gettextMethod · 0.45
test_format_dateMethod · 0.45

Calls 3

recursive_unicodeFunction · 0.90
get_argumentsMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected