code: def _get_content(self, response):
          
          method = response.request.method
          self.last_response = response
  
          server_error = {
              'summary': None,
              'details': None
          }
  
          try:
              content_json = response.json()
              if 'error' in content_json:
                  e = content_json['error']
                  if 'message' in e:
                      server_error['summary'] = e['message']
                  if 'detail' in e:
                      server_error['details'] = e['detail']
          except ValueError:
              content_json = {}
  
          if method == 'DELETE':
              # Make sure the delete operation returned the expected response
              if response.status_code == 204:
                  return {'success': True}
              else:
                  raise UnexpectedResponse(
                      204, response.status_code, method,
                      server_error['summary'], server_error['details']
                  )
          # Make sure the POST operation returned the expected response
          elif method == 'POST' and response.status_code != 201:
              raise UnexpectedResponse(
                  201, response.status_code, method,
                  server_error['summary'], server_error['details']
              )
          # It seems that Helsinki and later returns status 200 instead of 404 on empty result sets
          if ('result' in content_json and len(content_json['result']) == 0) or response.status_code == 404:
              if self.raise_on_empty is True:
                  raise NoResults('Query yielded no results')
          elif 'error' in content_json:
              raise UnexpectedResponse(
                  200, response.status_code, method,
                  server_error['summary'], server_error['details']
              )
  
          if 'result' not in content_json:
              raise MissingResult("The request was successful but the content didn't contain the expected 'result'")
  
          return content_json['result']
docs: Checks for errors in the response. Returns response content, in bytes.
  
          :param response: response object
          :raise:
              :UnexpectedResponse: if the server responded with an unexpected response
          :return:
              - ServiceNow response content