Curl command on windows not passing user:pass correctly

China☆狼群 提交于 2019-12-11 18:33:50

问题


I'm using CURL to execute some API calls against a bitbucket server. The command is like this:

curl https://bitbucket.myserver.com/rest/api/1.0/projects/PRJ/repos/repo-slug/tags \
     -u 'user:pass' \
     -X POST \
     -H 'Content-type: application/json' \
     -d '{"name" : "test-tag", "message": "Test tag from curl", "startPoint": "master" }'

This is expected to create a tag on the master branch in the repo. This however fails complaining of incorrect username/password.

I then copy/paste the command into git-bash prompt - and it works as expected, completing successfully. I tried this with multiple user accounts. I also tried specifying only the username and then entering the password on command line - with the same results.

How can I get curl on windows to pass correct username/password to the server?

来源:https://stackoverflow.com/questions/53194752/curl-command-on-windows-not-passing-userpass-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!