带有JSON的基本授权标头

时间:2018-02-24 17:25:21

标签: curl authorization

使用Basic Authoirzation标头运行curl会引发以下错误。我试过给双引号和其他可能性,但我仍然得到同样的错误。不知道这里有什么问题

curl -k http://localhost:8080/api/session -H 'Authorization:Basic lkfnnlknvldfbvkjbfjkbkjbfdknbfdlknv==' -H Accept:application/json -X POST
curl: (22) The requested URL returned error: 400 Bad Request
curl: (6) Could not resolve host: lkfnnlknvldfbvkjbfjkbkjbfdknbfdlknv=='; Name or service not known

其他尝试:

curl -k http://localhost:8080/api/session -H 'Authorization:lkfnnlknvldfbvkjbfjkbkjbfdknbfdlknv==' -H Accept:application/json -X POST
curl: (22) The requested URL returned error: 400 Bad Request

0 个答案:

没有答案