This is the updated code:
for (int i = 0; i < request.params.size(); i++) {
std::cout << "param value: " << request.params[i].get_str() << " param type: " <<
request.params[i].getType() << std::endl;
}
std::cout << "inside function" << std:: endl;
const int64_t num_blocks{request.params[0].get_int64()};
const uint64_t max_tries{request.params[3].isNull() ? DEFAULT_MAX_TRIES : request.params[3].get_int64()};
For me the getType() function redirects to UniValue class at:
https://github.com/bitcoin/bitcoin/blob/master/src/univalue/include/univalue.h#L64Type 3 is VSTR according to the VType enum