On the page of snapd REST API, it shows how to sideload a snap by sending request.
However, I am not clear what is the value for the key of the filename. The example shows as the following:
Content-Disposition: form-data; name=“snap”; filename=“hello-world_27.snap”
<20480 bytes of snap file data>
I am assuming I need to read the snap file as a byte stream and decode it as a string. Then use this string to replace <20480 bytes of snap file data>.
I tried to decode it as “utf-8”, I got the following error:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf8 in position 9: invalid start byte
Can anyone tell me I am on the right path and how to do it?
Thanks in advance!