mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Fix core 3.0.2 compile error
This commit is contained in:
parent
a538e4e589
commit
5c775553be
@ -7705,6 +7705,7 @@ uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, uint32
|
|||||||
|
|
||||||
|
|
||||||
int32_t http_req(char *host, char *request) {
|
int32_t http_req(char *host, char *request) {
|
||||||
|
WiFiClient http_client;
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
int32_t httpCode = 0;
|
int32_t httpCode = 0;
|
||||||
uint8_t mode = 0;
|
uint8_t mode = 0;
|
||||||
@ -7721,12 +7722,12 @@ int32_t http_req(char *host, char *request) {
|
|||||||
// GET
|
// GET
|
||||||
strcat(hbuff, request);
|
strcat(hbuff, request);
|
||||||
//AddLog(LOG_LEVEL_INFO, PSTR("HTTP GET %s"),hbuff);
|
//AddLog(LOG_LEVEL_INFO, PSTR("HTTP GET %s"),hbuff);
|
||||||
http.begin(hbuff);
|
http.begin(http_client, hbuff);
|
||||||
httpCode = http.GET();
|
httpCode = http.GET();
|
||||||
} else {
|
} else {
|
||||||
// POST
|
// POST
|
||||||
//AddLog(LOG_LEVEL_INFO, PSTR("HTTP POST %s - %s"),hbuff, request);
|
//AddLog(LOG_LEVEL_INFO, PSTR("HTTP POST %s - %s"),hbuff, request);
|
||||||
http.begin(hbuff);
|
http.begin(http_client, hbuff);
|
||||||
http.addHeader("Content-Type", "text/plain");
|
http.addHeader("Content-Type", "text/plain");
|
||||||
httpCode = http.POST(request);
|
httpCode = http.POST(request);
|
||||||
}
|
}
|
||||||
@ -7745,6 +7746,7 @@ int32_t http_req(char *host, char *request) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
http.end();
|
http.end();
|
||||||
|
http_client.stop();
|
||||||
|
|
||||||
return httpCode;
|
return httpCode;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user