我有下面的curl命令,我想将其转换为PowerShell(PowerShell v3.0):
curl -s -k -H 'Authorization: api_key 1234567890' -F upload_file=@"C:\path\to\file" -X POST "https://my.url.com/submit"
到目前为止我所拥有的:
$Body= @{ "upload_file" = "C:\path\to\file" };
$Headers = @{ "Authorization" = "api_key 1234567890" };
$Uri = "https://my.url.com/submit"
Invoke-WebRequest -Method Post -Uri $Uri -H $Headers -Body $Body
我认为form参数是个问题。
谢谢。