I\'m currently trying to upload a file to a Webserver by using a REST API. And as mentioned I\'m using PowerShell for this. With curl this is no problem. The call looks like
It should be pretty straight forward. Taking from this answer:
$Uri = 'https://server/api/';
$Headers = @{'Auth_token'=$AUTH_TOKEN};
$FileContent = [IO.File]::ReadAllText('C:\test\test.test');
$Fields = @{'appInfo'='{"name": "test","description": "test"}';'uploadFile'=$FileContent};
Invoke-RestMethod -Uri $Uri -ContentType 'multipart/form-data' -Method Post -Headers $Headers -Body $Fields;
You may want to use [IO.File]::ReadAllBytes()
if the file isn't a text file.
This also may not work well if you're uploading a huge file.