From 5bf4689a70e2846f62fe996e25a3abe52e76baca Mon Sep 17 00:00:00 2001 From: Miziziziz Date: Thu, 3 Jul 2025 00:32:47 -0400 Subject: [PATCH] fix image download example code using "https://placehold.co/512" as the url will cause image.load_png_from_buffer(body) to throw ERR_FILE_CORRUPT, need to specify that it's a png file in the url. --- doc/classes/HTTPRequest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 4275251d8c9..b3fdc0363a8 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -90,7 +90,7 @@ http_request.request_completed.connect(self._http_request_completed) # Perform the HTTP request. The URL below returns a PNG image as of writing. - var error = http_request.request("https://placehold.co/512") + var error = http_request.request("https://placehold.co/512.png") if error != OK: push_error("An error occurred in the HTTP request.") @@ -120,7 +120,7 @@ httpRequest.RequestCompleted += HttpRequestCompleted; // Perform the HTTP request. The URL below returns a PNG image as of writing. - Error error = httpRequest.Request("https://placehold.co/512"); + Error error = httpRequest.Request("https://placehold.co/512.png"); if (error != Error.Ok) { GD.PushError("An error occurred in the HTTP request.");