Upload a package file not working
Summary
We have our own Gitlab server (version 14.10.0) And I am trying to use generic package feature on a group. Using the basic example curl query does not work: it says "The provided content-type '' is not supported."
Steps to reproduce
Query:
curl --header "PRIVATE-TOKEN: XXXX" --upload-file ./file.txt "https://MYURL/api/v4/groups/3/packages/generic/my_package/0.0.1/file.txt"
Result:
{"error":"The provided content-type '' is not supported."}
What is the current bug behavior?
I have tried to add the content-type like this:
Query:
curl --header "PRIVATE-TOKEN: XXXX" --header "CONTENT-TYPE:text/plain" --upload-file ./file.txt "https://MYURL/api/v4/groups/3/packages/generic/my_package/0.0.1/file.txt"
Result:
{"error":"The provided content-type 'text/plain' is not supported."}
With application/json content-type, it returns nothing
Query:
curl --header "PRIVATE-TOKEN: XXXX" --header "CONTENT-TYPE:application/json" --upload-file ./file.txt "https://MYURL/api/v4/groups/3/packages/generic/my_package/0.0.1/file.txt"
Result:
NULL
What is the expected correct behavior?
curl --header "PRIVATE-TOKEN: XXXX" --upload-file ./file.txt "https://MYURL/api/v4/groups/3/packages/generic/my_package/0.0.1/file.txt"
Result:
{ "message":"201 Created" }
Like the example here: https://docs.gitlab.com/ee/user/packages/generic_packages/index.html