

def _ingest_response(self, response):
    'Takes a response object and ingests state, links, embedded\n        documents and updates the self link of this navigator to\n        correspond. This will only work if the response is valid\n        JSON\n        '
    self.response = response
    if self._can_parse(response.headers['Content-Type']):
        hal_json = hal_json._parse_content(response.text)
    else:
        raise exc.HALNavigatorError(message='Unexpected content type! Wanted {0}, got {1}'.format(self.headers.get('Accept', self.DEFAULT_CONTENT_TYPE), self.response.headers['content-type']), nav=self, status=self.response.status_code, response=self.response)
    self._links = self._make_links_from(hal_json)
    self._embedded = self._make_embedded_from(hal_json)
    self._update_self_link(hal_json.get('_links', {
        
    }).get('self', {
        
    }), response.headers)
    self.curies = dict(((curie['name'], curie['href']) for curie in hal_json.get('_links', {
        
    }).get('curies', [])))
    self.state = utils.getstate(hal_json)

dataset/ETHPy150Open deontologician/restnavigator/restnavigator/halnav.py HALNavigatorBase._ingest_response/VarMisuse@37/125 `self`->`hal_json`