From 4a9bb49319ebc8b450356e2406963a19197b1362 Mon Sep 17 00:00:00 2001 From: Sindre Hansen Date: Tue, 28 May 2024 18:47:54 +0200 Subject: [PATCH] Fix samples for updating with custom binaries --- http-api.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/http-api.yml b/http-api.yml index 5bdae0c4..1b88fc0a 100644 --- a/http-api.yml +++ b/http-api.yml @@ -1036,12 +1036,13 @@ paths: x-codeSamples: - lang: "curl" source: | - curl -X POST "http://192.168.1.101/surface_unit/update" --data-binary "@firmware.bin" + curl -X POST -F "update-file=@firmware.bin" "http://192.168.1.101/surface_unit/update" - lang: "Python" source: | import requests with open("firmware.bin", "rb") as f: - response = requests.post("http://192.168.1.101/surface_unit/update", data=f) + files = {'update-file': f} + response = requests.post("http://192.168.1.101/surface_unit/update", files=files) print(response.status_code) components: