curl token command returning empty JSON array
Aki1024 opened this issue · 1 comments
When I run curl -u "Aki" https://try.gogs.io/api/v1/users/Aki/tokens, the command hangs until I send a ctrl+c, which causes bash to display Enter host password for user Aki: and bash's input is ready for a new command. If I enter a password while after the initial command, the hang continues, and when I ctrl+c after, the dialog appears, and the password I entered earlier gets ran as though it was a command. When I run curl -u "Aki:mypassword" https://try.gogs.io/api/v1/users/Aki/tokens I see bash download a file, and that file is an empty JSON array.
Using curl http://Aki:mypassword@try.gogs.io/api/v1/users/Aki/tokens -o Aki.txt results in a Moved Permanently message on try.gogs.io, and an empty array on my local repository. Looking at the website, I couldn't see a way to get an API key from my profile either.
(passwords in orange, last also covering local host address)

Do I need to use a different bash client? (Git Bash is what I have). Is there a way to get the API key via the website? I'm not sure what I can try next to get access to the rest of the API.
I still can't get curl to work for me on either local or the test website, but I have found out where to get access tokens via my profile (Settings -> Applications -> Generate New Token). Closing issue. I also understand now that calls above are to get existing access tokens. The wording "Basic authentication can only be used to obtain access tokens." made me believe this was where to obtain new ones.