parameters: (request, param_name)
docstring: Switches the host using a parameter value from a JSON request body
docstring_summary: Switches the host using a parameter value from a JSON request body
docstring_tokens: Switches the host using a parameter value from a JSON request body
function: def switch_host_with_param(request, param_name):
      """Switches the host using a parameter value from a JSON request body"""
      request_json = json.loads(request.data.decode('utf-8'))
      if request_json.get(param_name):
          new_endpoint = request_json[param_name]
          _switch_hosts(request, new_endpoint)
function_tokens: def switch_host_with_param ( request , param_name ) : request_json = json . loads ( request . data . decode ( 'utf-8' ) ) if request_json . get ( param_name ) : new_endpoint = request_json [ param_name ] _switch_hosts ( request , new_endpoint )