If the health_check_endpoint param was not specified, request_body_params["health_check_endpoint"] params is explicitly nil, and the default value of /up is not used. Add a constant for the default value, and use that. An alternative approach would be do not pass the keyword argument if the parameter is not set, but that seemed like more work.