I want to know if the network to which esp connected has internet connectivity or not. How can I send a ping request using esp32?
If you want to test internet connectivity the best way is to request http://google.com. If your device is connected to internet, you would get 301 as response code.
You can ping some address and see if it is reachable. You can use this library for the same.