Stop using deprecated HTTPClient::begin()
@@ -227,13 +227,16 @@ void WSClient::connect() {
void WSClient::test_token(const String server_address,
const uint16_t server_port) {
+ // Needed for HTTPClient::begin, below
+ WiFiClient client;
+
// FIXME: implement async HTTP client!
HTTPClient http;
String url = String("http://") + server_address + ":" + server_port +
"/signalk/v1/api/";
debugD("Testing token with url %s", url.c_str());
- http.begin(url);
+ http.begin(client, url);
String full_token = String("JWT ") + auth_token;
http.addHeader("Authorization", full_token.c_str());
int httpCode = http.GET();
@@ -283,11 +286,14 @@ void WSClient::send_access_request(const String server_address,
String json_req = "";
serializeJson(doc, json_req);
+ // Needed for HTTPClient::begin, below
+ WiFiClient client;
+
HTTPClient http;
String url = String("http://") + server_address + ":" + server_port +
"/signalk/v1/access/requests";
- http.begin(url);
+ http.begin(client, url);
http.addHeader("Content-Type", "application/json");
int httpCode = http.POST(json_req);
String payload = http.getString();
@@ -329,10 +335,13 @@ void WSClient::poll_access_request(const String server_address,
const String href) {
debugD("Polling SK Server for authentication token");
+ // Needed for HTTPClient::begin, below
+ WiFiClient client;
+
HTTPClient http;
String url = String("http://") + server_address + ":" + server_port + href;
- http.begin(url);
+ http.begin(client, url);
int httpCode = http.GET();
if (httpCode == 200 or httpCode == 202) {
String payload = http.getString();
