@@ -155,6 +155,40 @@ class ESP8266WebServerTemplate
155
155
// code - HTTP response code, can be 200 or 404
156
156
// content_type - HTTP content type, like "text/plain" or "image/png"
157
157
// content - actual content body
158
+
159
+ #if 0
160
+
161
+ void send(int code) { send(code, nullptr, nullptr); }
162
+
163
+ template <CT content_type, CD content>
164
+ void send(int code, CT&& content_type, CD&& content)
165
+ {
166
+ String(std::forward<CT>(content_type)) content_type_forwarded;
167
+ StreamConstPtr(std::forward<CD>(content)) content_forwarded;
168
+ send(code, content_type_forwarded.c_str(), &content_forwarded);
169
+ }
170
+
171
+ template <CT content_type, C content>
172
+ void send(int code, CT&& content_type, C&& content, size_t content_length)
173
+ {
174
+ String(std::forward<CT>(content_type)) content_type_forwarded;
175
+ StreamConstPtr(std::forward<CD>(content), content_length) content_forwarded;
176
+ send(code, content_type_forwarded.c_str(), &content_forwarded);
177
+ }
178
+
179
+ template <CT content_type>
180
+ void send(int code, CT&& content_type, Stream* stream, size_t content_length = 0)
181
+ {
182
+ String(std::forward<CT>(content_type)) content_type_forwarded;
183
+ send(code, content_type_forwarded.c_str(), stream, content_length);
184
+ }
185
+
186
+ send_P
187
+
188
+
189
+ #else
190
+
191
+
158
192
void send (int code, const char * content_type = NULL , const String& content = emptyString) {
159
193
return send (code, content_type, content.c_str (), content.length ());
160
194
}
@@ -185,6 +219,8 @@ class ESP8266WebServerTemplate
185
219
return send (code, String (content_type).c_str (), &ref);
186
220
}
187
221
222
+ #endif
223
+
188
224
void send (int code, const char * content_type, Stream* stream, size_t content_length = 0 );
189
225
190
226
void setContentLength (const size_t contentLength);
0 commit comments