Does anybody know what the request body looks like if I want to use Nexus API to upload artifact to a repo?
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("admin123:password123"))
$header = @{authorization = "Basic $token" }
$body = @{
'raw.dictionary' = '/TestArtifact/Prod/'
'raw.asset1' = 'c:\temp\lenovo.zip'
'raw.asset1.filename' = 'lenovo.zip'
} | Convertto-Json
Invoke-RestMethod -Method POST -Uri 'http://xx.xx.xxx.xxx:8081/service/rest/v1/components?repository=TestRepo' -ContentType 'application/json'-Body $body -Headers $header
I'm getting 'Invoke-RestMethod: Response status code does not indicate success: 415 (Unsupported Media Type)'