I need to create a performance test for Nuget repository using Jmeter tool and I need to deploy/upload .nupkg files to the repository however I have a problem with uploading. I receive error number 415 - Unsupported media type. Seems like something wrong with a Content-Type or with multipart/form-data transmission which has to be used for upload. The Jmeter has such option for POST but I have PUT in my case.
The curl below publishes properly
curl -XPUT http://hostname/api/nuget/nuget/ -u login:password -F "package=@/home/nugetFiles/shay-1-test.2.1.0.nupkg"
I have unsuccessfully tried the following - added file path in the Files Upload tab in the HTTP request sampler, added HTTP Header Manager as a child and tried the upload uing several variants with different Content-Types via HTTP Header Manager item.
- application/x-nupkg;
- application/octet-stream;
- multipart/form-data; boundary="6aec860d-8c85-4cea-854e-a051e77873c4";
and Content-Disposition value
- Content-Disposition: form-data; name=package; filename=package.nupkg; filename*=utf-8''package.nupkg
HTTP header manager also has X-NuGet-ApiKey value
I also found out that the file should be added to the request body however I do not know how to do it.
Please help.