(self, request)
| 32 | sys.stdout.flush() |
| 33 | |
| 34 | def format_data(self, request): |
| 35 | if request['content_type'] in ['text', 'json']: |
| 36 | data = request['data'] |
| 37 | elif request['content_type'] == 'binary': |
| 38 | data = self.wrap_binary_data(request['data']) |
| 39 | else: |
| 40 | raise Exception("Invalid content_type: {}".format(request['content_type'])) |
| 41 | return data |
| 42 | |
| 43 | def is_binary(self, arg): |
| 44 | if six.PY3: |