MCPcopy Index your code
hub / github.com/python/cpython / handle_request

Method handle_request

Lib/xmlrpc/server.py:680–700  ·  view source on GitHub ↗

Handle a single XML-RPC request passed through a CGI post method. If no XML data is given then it is read from stdin. The resulting XML-RPC response is printed to stdout along with the correct HTTP headers.

(self, request_text=None)

Source from the content-addressed store, hash-verified

678 sys.stdout.buffer.flush()
679
680 def handle_request(self, request_text=None):
681 """Handle a single XML-RPC request passed through a CGI post method.
682
683 If no XML data is given then it is read from stdin. The resulting
684 XML-RPC response is printed to stdout along with the correct HTTP
685 headers.
686 """
687
688 if request_text is None and \
689 os.environ.get('REQUEST_METHOD', None) == 'GET':
690 self.handle_get()
691 else:
692 # POST data is normally available through stdin
693 try:
694 length = int(os.environ.get('CONTENT_LENGTH', None))
695 except (ValueError, TypeError):
696 length = -1
697 if request_text is None:
698 request_text = sys.stdin.read(length)
699
700 self.handle_xmlrpc(request_text)
701
702
703# -----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 4

handle_getMethod · 0.95
handle_xmlrpcMethod · 0.95
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected