Hi,
I am having the same trouble with multiple parameters here, using Gitlab Community Edition [11.4.9].
I need to access a raw file, just by providing an URI string. Theoretically it could be possible, using a query string with two parameters : ref and private_token, but apparently only the first query parameter is supported :
If I put the private_token first, eg:
curl https://mygitlab.domain/api/v4/projects/<project>/repository/files/<path>/raw?private_token=<token>&ref=master
I get :
{"error":"ref is missing, ref is empty"}
If I put the ref=master first, eg:
curl https://mygitlab.domain/api/v4/projects/<project>/repository/files/<path>/raw?ref=master&private_token=<token>
I get:
{"message":"404 Project Not Found"}
Only if I put the token into a HTTP header :
curl --header 'PRIVATE-TOKEN: <token>' https://mygitlab.domain/api/v4/projects/<project>/repository/files/<path>/raw?ref=master
It works. But this is not acceptable because I can only provide a simple string URI (here I only use curl
for debugging purpose).
Using a previous Gitlab version, before my sysadmin upgraded it, it was possible to have a URI like :
https://mygitlab.domain/<project>/raw/master/<path>?private_token=<token>
And it was working fine, but now this syntax seems not to be supported anymore, and I cannot find any working alternatives.
Any help would be greatly appreciated.
Thanks