0

在我的 bash 脚本中尝试使用带有 --netrc-file 选项的 curl 时遇到了问题。当我只是把curl -d "username=MYUSR&password=MYPSWD" https://st-machinexxx/api -c cookies.txt 它工作正常。但是curl --netrc-file configfile.txt https://st-machinexxx/api -c cookies.txt 会导致 HTTP ERROR 401。可能是什么原因?我试图通过添加--digest、--negotiate 和--ntlm 以及设置一些标题来设置认证方法,但没有帮助。我正在使用 curl 7.29.0,configfile.txt 只包含三行:

machine st-machinexxx
login MYUSR
password MYPSWD
4

0 回答 0