The /api2/json/nodes/{node}/storage/{storage}/upload api endpoint appears to require the content-type to be multipart/form-data to be able to upload a file. The following curl command is able to upload the <iso_filename> to proxmox server.
If a json format, which the repo uses with application/x-www-urlencoded, is used instead, it returns a HTTP 502 error. This might be due to it not expecting a json format. Currently, it doesn't appear possible to upload a file using the proxmox endpoint.
I'm planning to implement this feature in my project. Once I reach that stage, I'll have more insights and practical experience to share. I'll make sure to update this thread as soon as I do.
The
/api2/json/nodes/{node}/storage/{storage}/upload
api endpoint appears to require the content-type to bemultipart/form-data
to be able to upload a file. The following curl command is able to upload the<iso_filename>
to proxmox server.If a json format, which the repo uses with
application/x-www-urlencoded
, is used instead, it returns a HTTP 502 error. This might be due to it not expecting a json format. Currently, it doesn't appear possible to upload a file using the proxmox endpoint.As reference, Post with REST api on this endpoint and Proxmox api documentation
From me and @williamhatcher