MCPcopy Index your code
hub / github.com/aws/aws-cli / get_response

Function get_response

awscli/botocore/response.py:153–174  ·  view source on GitHub ↗
(operation_model, http_response)

Source from the content-addressed store, hash-verified

151
152
153def get_response(operation_model, http_response):
154 protocol = operation_model.service_model.resolved_protocol
155 response_dict = {
156 'headers': http_response.headers,
157 'status_code': http_response.status_code,
158 }
159 # TODO: Unfortunately, we have to have error logic here.
160 # If it looks like an error, in the streaming response case we
161 # need to actually grab the contents.
162 if response_dict['status_code'] >= 300:
163 response_dict['body'] = http_response.content
164 elif operation_model.has_streaming_output:
165 response_dict['body'] = StreamingBody(
166 http_response.raw, response_dict['headers'].get('content-length')
167 )
168 else:
169 response_dict['body'] = http_response.content
170
171 parser = parsers.create_parser(protocol)
172 return http_response, parser.parse(
173 response_dict, operation_model.output_shape
174 )

Callers

nothing calls this directly

Calls 3

StreamingBodyClass · 0.85
create_parserMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected