Closed lbussy closed 3 years ago
This can be addressed the same way I did it in Brew Bubbles. Use LCBUrl to get/cache the IP address (it's available in Arduino as well as PlatformIO library manager):
Then you can use WiFiClient::client()
to send manually (rather than using HTTPClient::client()
:
Using LCBUrl will allow you to parse out sections of a longer, more complex URL. I don't think I am using the LCBUrl::getIP()
method in Brew Bubbles yet (ironic), so look at that to make things even simpler.
(You'll also note some IP address validity checks that you can apply where you are doing some convoluted work presently.)
When posting to an mDNS name, the post fails:
I'm fairly certain HTTPClient::begin() will not resolve mDNS, however, DNS queries will so you can get the IP and cache it before that.