curl -H "Content-Type: application/json; charset=UTF-8" -d '{"username":"admin","password":"admin"}' http://localhost:2990/jira/rest/auth/1/session
我在DOS中使用了上述查询,我总是收到以下错误:
{“errorMessages”:[“意外字符('''(代码39)):预期a 有效值(数字,字符串,数组,对象,'true','false'或 'null')\ n在[来源: org.apache.catalina.connector.CoyoteInputStream@1fd9611;行:1, 专栏:2]“]}
我尝试了许多排列和组合..但它仍无法正常工作..
答案 0 :(得分:4)
它是一个窗户的东西,
尝试将'
替换为"
,将"
替换为"""
。
curl -H "Content-Type: application/json; charset=UTF-8" -d "{"""username""":"""admin""","""password""":"""admin"""}" ...
答案 1 :(得分:2)
在OSX上为我工作。 39是单引号char,但我看不出它来自哪里。