def convert_to_response_dict(http_response, operation_model):
 response_dict = {'headers': http_response.headers, 'status_code': http_response.status_code}
 if (response_dict['status_code'] >= 300):
  response_dict['body'] = http_response.content
 elif operation_model.has_streaming_output:
  response_dict['body'] = StreamingBody(http_response.raw, response_dict['headers'].get('content-length'))
 else:
  response_dict['body'] = http_response.content
 return response_dict

def convert_to_response_dict ( http_response , operation_model ) : response_dict = { 'headers' : http_response . headers , 'status_code' : http_response . status_code } if ( response_dict [ 'status_code' ] >= 300 ) : response_dict [ 'body' ] = http_response . content elif operation_model . has_streaming_output : response_dict [ 'body' ] = StreamingBody ( http_response . raw , response_dict [ 'headers' ] . get ( 'content-length' ) ) else : response_dict [ 'body' ] = http_response . content return response_dict
convert an http response object to a request dict .