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)
| 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 | # ----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected