'bool HTTPClient::begin(String)' is deprecated

It’s a warning, not an error. Nevermind it’s marked as error through special GCC attributes.

The deprecation is clearly marked in the library code:

To use the new API, rewrite

        HTTPClient http;
        http.begin(serverNameon);

to

        WiFiClient client;
        HTTPClient http;
        http.begin(client, serverNameon);

just like in the official example