First of all, I think you’re approaching this from the wrong direction.
Presumably you are trying to get data from one Blynk connected device to another, but rather than obtaining this via an HTTP request from this device, you’d be better pushing the data via an HTTP command from your other device.
The only drawback you’ll face with that approach when using Edgent is that your other device needs to know the Blynk auth token of this device, which is allocated dynamically, but that’s easy enough to work around.
This approach (which was previously supported in Blynk Legacy as a system known as Bridge, is discussed in this topic…
You should scroll-up a bit to post #27 where I first described the code that I wrote for the ESP32.
The advantage of using this data push method from your slave device(s) is that it will trigger the BLYNK_WRITE(vPin)
callback function on your master device when new data becomes available. This saves you having to constantly poll the Blynk server for new data, and makes the system more responsive too.
As far as your code is concerned, here are a few comments…
The newer ESP8266 HTTP client does indeed require you to specify the connection that the HTTP client is going to use. However, as you point-out, that WiFi connection already exists, and you don’t need to create another connection. You just need to create an object that you’ll use, which acts as an alias for the pre-existing WiFi connection, like this…
WiFiClient my_wifi_client;
then use my_wifi_client
when you initialise the HTTP client.
You aren’t initialising an HTTP client object either, like this…
HTTPClient http;
and ending that client object with an http.end();
either.
You are making the HTTP call using //blynk.cloud
and it’s safer to add-in the subdomain for the regional server where your project lives. My project is on the 'lon1server, so I'd use
//lon1.blynk.cloud`
Pete.