code: def _process_response(response):
      
      # Read the response as JSON
      try:
          data = response.json()
      except ValueError:
          _log_and_raise_exception('Invalid response', response.text)
  
      # Default case, Got proper response
      if response.status_code == 200:
          return { 'headers': response.headers, 'data': data }
      return _raise_error_from_response(data)
docs: Make the request and handle exception processing