def f(self, *args, **kwargs): rendered = method(self, *args, **kwargs) if 'json' in self.headers.get('Content-Type', []): self.response_headers.update( {'x-amzn-requestid': '2690d7eb-ed86-11dd-9877-6fad448a8419', 'date': datetime.now(pytz.utc).strftime('%a, %d %b %Y %H:%M:%S %Z'), 'content-type': 'application/x-amz-json-1.1'}) resp = xml_to_json_response(self.aws_service_spec, operation, rendered) return '' if resp is None else json.dumps(resp) return rendered
def f(self, *args, **kwargs): rendered = method(self, *args, **kwargs) if 'json' in self.headers.get('Content-Type', []): self.response_headers.update( {'x-amzn-requestid': '2690d7eb-ed86-11dd-9877-6fad448a8419', 'date': datetime.now(pytz.utc).strftime('%a, %d %b %Y %H:%M:%S %Z'), 'content-type': 'application/x-amz-json-1.1'}) resp = xml_to_json_response( self.aws_service_spec, operation, rendered) return '' if resp is None else json.dumps(resp) return rendered
def f(self, *args, **kwargs): rendered = method(self, *args, **kwargs) if "json" in self.headers.get("Content-Type", []): self.response_headers.update( { "x-amzn-requestid": "2690d7eb-ed86-11dd-9877-6fad448a8419", "date": datetime.now(pytz.utc).strftime( "%a, %d %b %Y %H:%M:%S %Z" ), "content-type": "application/x-amz-json-1.1", } ) resp = xml_to_json_response(self.aws_service_spec, operation, rendered) return "" if resp is None else json.dumps(resp) return rendered