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

Method handle_get

Lib/xmlrpc/server.py:655–678  ·  view source on GitHub ↗

Handle a single HTTP GET request. Default implementation indicates an error because XML-RPC uses the POST method.

(self)

Source from the content-addressed store, hash-verified

653 sys.stdout.buffer.flush()
654
655 def handle_get(self):
656 """Handle a single HTTP GET request.
657
658 Default implementation indicates an error because
659 XML-RPC uses the POST method.
660 """
661
662 code = 400
663 message, explain = BaseHTTPRequestHandler.responses[code]
664
665 response = http.server.DEFAULT_ERROR_MESSAGE % \
666 {
667 'code' : code,
668 'message' : message,
669 'explain' : explain
670 }
671 response = response.encode('utf-8')
672 print('Status: %d %s' % (code, message))
673 print('Content-Type: %s' % http.server.DEFAULT_ERROR_CONTENT_TYPE)
674 print('Content-Length: %d' % len(response))
675 print()
676 sys.stdout.flush()
677 sys.stdout.buffer.write(response)
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.

Callers 1

handle_requestMethod · 0.95

Calls 3

encodeMethod · 0.45
flushMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected