I'm trying to load an image (.png) into my Gitlab project using an API call from powershell but it doesn't work
$token = "<my_access_token>"
$projectId = "5"
$file = "path\test.png"
$apiUrl = "https://gitlab.example.com/api/v4/projects/5/uploads"
Invoke-RestMethod -Uri $apiUrl -Method Post -Headers @{ "PRIVATE-TOKEN" = $token } -InFile $file -ContentType "image/png"
the error message is:
Invoke-RestMethod : {"error":"The provided content-type 'image/png' is not supported."} I have tried different options but I can't get it to work. Any suggestions?
Thanks