Skip to content

Commit 93d57fa

Browse files
committed
Remove overloads of HTTPClient::begin which take const char*
Since the data is stored as Strings internally, these methods do not serve as an optimisation
1 parent 2301f29 commit 93d57fa

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,6 @@ HTTPClient::~HTTPClient() {
7878
}
7979
}
8080

81-
/**
82-
* phasing the url for all needed informations
83-
* @param url const char *
84-
* @param httpsFingerprint const char *
85-
*/
86-
void HTTPClient::begin(const char *url, const char * httpsFingerprint) {
87-
begin(String(url), String(httpsFingerprint));
88-
}
89-
9081
/**
9182
* phasing the url for all needed informations
9283
* @param url String
@@ -158,18 +149,7 @@ void HTTPClient::begin(String url, String httpsFingerprint) {
158149

159150
}
160151

161-
/**
162-
* begin
163-
* @param host const char *
164-
* @param port uint16_t
165-
* @param url const char *
166-
* @param https bool
167-
* @param httpsFingerprint const char *
168-
*/
169-
void HTTPClient::begin(const char *host, uint16_t port, const char * url, bool https, const char * httpsFingerprint) {
170-
171-
DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port:%d url: %s https: %d httpsFingerprint: %s\n", host, port, url, https, httpsFingerprint);
172-
152+
void HTTPClient::begin(String host, uint16_t port, String url, bool https, String httpsFingerprint) {
173153
_host = host;
174154
_port = port;
175155
_url = url;
@@ -181,10 +161,7 @@ void HTTPClient::begin(const char *host, uint16_t port, const char * url, bool h
181161

182162
_Headers = "";
183163

184-
}
185-
186-
void HTTPClient::begin(String host, uint16_t port, String url, bool https, String httpsFingerprint) {
187-
begin(host.c_str(), port, url.c_str(), https, httpsFingerprint.c_str());
164+
DEBUG_HTTPCLIENT("[HTTP-Client][begin] host: %s port:%d url: %s https: %d httpsFingerprint: %s\n", host, port, url, https, httpsFingerprint);
188165
}
189166

190167
/**

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,11 @@ class HTTPClient {
125125
HTTPClient();
126126
~HTTPClient();
127127

128-
void begin(const char *url, const char * httpsFingerprint = "");
129128
void begin(String url, String httpsFingerprint = "");
130-
131-
void begin(const char *host, uint16_t port, const char * url = "/", bool https = false, const char * httpsFingerprint = "");
132129
void begin(String host, uint16_t port, String url = "/", bool https = false, String httpsFingerprint = "");
133130

134131
void end(void);
135-
132+
136133
bool connected(void);
137134

138135
void setReuse(bool reuse); /// keep-alive

0 commit comments

Comments
 (0)