0

I'm using code from gitlab docs for getting xmlfile from repository:

curl --request GET --header 'PRIVATE-TOKEN: MYTOKEN' 'https://gitlab.com/semborfo/tester/raw/COMMIT_HASH/PoliqonSysem.xml'

But then getting

curl: (6) Could not resolve host: MYTOKEN' 
curl: (1) Protocol "'https" not supported or disabled in libcurl

Can u help me with this problem? i have already spent 4 hours for this

phd
  • 82,685
  • 13
  • 120
  • 165
SimonZen
  • 131
  • 1
  • 11
  • I guess it is a _gitlab_ problem, not a _git_ problem, isn't it? – OznOg Jun 06 '19 at 15:00
  • 2
    It looks like it could be a problem with the quoting of the arguments in the shell. `Could not resolve host: MYTOKEN` seems to indicate that it's splitting the header at space after the colon. Which shell are you using, or how are you calling curl? – Jonathan Villemaire-Krajden Jun 06 '19 at 15:03
  • i'm using it from CMD. u were right i deleted space, and now there is only one problem left, with libcurl – SimonZen Jun 06 '19 at 15:14
  • 2
    It might be the same as: https://stackoverflow.com/a/24232441/852893 – Jonathan Villemaire-Krajden Jun 06 '19 at 15:25
  • Possible duplicate of [curl : (1) Protocol https not supported or disabled in libcurl](https://stackoverflow.com/questions/6884669/curl-1-protocol-https-not-supported-or-disabled-in-libcurl) – phd Jun 06 '19 at 18:27

2 Answers2

1

curl: (6) Could not resolve host: MYTOKEN'

Seems like there is a trailing space, should be PRIVATE_TOKEN:MY_TOKEN

curl: (1) Protocol "'https" not supported or disabled in libcurl

Sometimes single quote ' are not really liked, try using "

Piou44
  • 101
  • 3
1

Try this:

curl --request GET --header "PRIVATE-TOKEN: aabbcc" https://sample.gitlab.com/api/v4/projects/5295/repository/files/lib%2Freference%2Fmaven%2Fsettings%2Exml/raw?ref=master

Where aabbcc is your private access token, it has an espace before aabbcc. This command will get content of settings.xml which is in:

myProject(project ID is 5295, branch master)
    -src
    -lib
       |-reference
             |-maven
                 |-settings.xml
zichen.L
  • 364
  • 3
  • 7