mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-11-03 14:33:37 +03:00 
			
		
		
		
	Passing custom HTTPClient to HTTPUpdate (#8773)
This enables passing additional headers to HTTP query. Based on ESP32 HTTPUpdate functionalities.
This commit is contained in:
		@@ -83,6 +83,16 @@ HTTPUpdateResult ESP8266HTTPUpdate::update(WiFiClient& client, const String& hos
 | 
				
			|||||||
    return handleUpdate(http, currentVersion, false);
 | 
					    return handleUpdate(http, currentVersion, false);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HTTPUpdateResult ESP8266HTTPUpdate::update(HTTPClient& httpClient, const String& currentVersion)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return handleUpdate(httpClient, currentVersion, false);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HTTPUpdateResult ESP8266HTTPUpdate::updateFS(HTTPClient& httpClient, const String& currentVersion)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return handleUpdate(httpClient, currentVersion, true);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * return error code as int
 | 
					 * return error code as int
 | 
				
			||||||
 * @return int error code
 | 
					 * @return int error code
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -120,6 +120,8 @@ public:
 | 
				
			|||||||
    t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = "/",
 | 
					    t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = "/",
 | 
				
			||||||
                               const String& currentVersion = "");
 | 
					                               const String& currentVersion = "");
 | 
				
			||||||
    t_httpUpdate_return updateFS(WiFiClient& client, const String& url, const String& currentVersion = "");
 | 
					    t_httpUpdate_return updateFS(WiFiClient& client, const String& url, const String& currentVersion = "");
 | 
				
			||||||
 | 
					    t_httpUpdate_return update(HTTPClient& httpClient, const String& currentVersion = "");
 | 
				
			||||||
 | 
					    t_httpUpdate_return updateFS(HTTPClient& httpClient, const String& currentVersion = "");
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // Notification callbacks
 | 
					    // Notification callbacks
 | 
				
			||||||
    void onStart(HTTPUpdateStartCB cbOnStart)          { _cbStart = cbOnStart; }
 | 
					    void onStart(HTTPUpdateStartCB cbOnStart)          { _cbStart = cbOnStart; }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user