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

Good afternoon all
I am using a 8266-01 board, and I’m having a problem finding a resolution that I can understand!!! To the following error:

‘bool HTTPClient::begin(String)’ is deprecated (declared at C:\Users\Paul.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:174) [-Wdeprecated-declarations]
Here is a code snippet and I have tried to emphasise the line with the error http.begin(serverNameon);

I can see there’s an update has caused this problem and that I now need to change the code but I have looked at the number of articles and I’m struggling to make it compile without an error. I realise this is just a warning message as the code does still work, but obviously sometime soon it will stop working completely.
As always any assistance/example would be gratefully appreciated

    if(WiFi.status()== WL_CONNECTED){
        HTTPClient http;
        ***http.begin(serverNameon);***
        http.addHeader("Content-Type", "application/x-www-form-urlencoded");
        String httpRequestData = "value1=" + String(Temperature) + "&value2=" + String(random(40))+ "&value3=" + String(random(40));
        int httpResponseCode = http.POST(httpRequestData);
        Serial.print("HTTP Response code: ");
        Serial.println(httpResponseCode);
        http.end();
    }
    else {
      Serial.println("WiFi Disconnected");
    }
}
//###################################################################################
void ifttt_off(){
    if(WiFi.status()== WL_CONNECTED){
        HTTPClient http;
        **http.begin(serverNameoff);**
        http.addHeader("Content-Type", "application/x-www-form-urlencoded");
        String httpRequestData = "value1=" + String(Temperature) + "&value2=" + String(random(40))+ "&value3=" + String(random(40));
        int httpResponseCode = http.POST(httpRequestData);
        Serial.print("HTTP Response code: ");
        Serial.println(httpResponseCode);
        http.end();
    }
    else {
      Serial.println("WiFi Disconnected");
    }
}

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

As always you make it look so easy but I still have this problem showing the same error
lcd.begin(0,2);
it still a 8266-01

void setup() {
  Serial.begin(115200); 
  Wire.pins(0, 2);
  lcd.begin(0,2);
  lcd.init();
  lcd.backlight();
  lcd.home();
  lcd.setCursor(0,0);
  lcd.print(" Connecting ");
  
  WiFi_ON();
  //setupOTA();
  DHT22_Setup();
  Time_Get();
  Run_Time();
  
  Web_Listen1.enableDelayed();
  Run_Time1.enableDelayed();
  Display1.enableDelayed();
}

‘void TwoWire::pins(int, int)’ is deprecated (declared at C:\Users\Paul.platformio\packages\framework-arduinoespressif8266\libraries\Wire/Wire.h:55) [-Wdeprecated-declarations]

So what have I done wrong this time?

Ok I can see that I need to Change Wire.pins(0, 2); to Wire.begin(0, 2);
So I presume that pins is no longer used?
Sorry for asking such silly questions
Thank you for your patience as always

Indeed – the compiler will always tell you in which file and line a certain warning or error was thrown, so you’re right to look there:

There it’s just marked as deprected but without error this time.

A little extra hint: The github page (and git in general) has this “Blame” button on the top right. You can then see which exact commit was responsible for changing a certain line. Shows in this case that the deprecation was marked an astonishing 6 years ago.

Usually when developers mark an API as “deprecated” it is subject to removal soon. But that one seems to have it dragged out a bit.