Error in curl when authenticating into JIRA

隐身守侯 提交于 2021-02-07 09:13:12

问题


curl  -H "Content-Type: application/json; charset=UTF-8" -d '{"username":"admin","password":"admin"}' http://localhost:2990/jira/rest/auth/1/session

I used the above query in DOS and I always get the following error :

{"errorMessages":["Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1fd9611; line: 1, column: 2]"]}

I tried many permutations and combinations .. Still it did not work ..


回答1:


Works for me on OSX. 39 is a single quote char but I don't see where that comes from.




回答2:


Its a windows thing, try to replace ' with " and " with """.

curl  -H "Content-Type: application/json; charset=UTF-8" -d "{"""username""":"""admin""","""password""":"""admin"""}" ...


来源:https://stackoverflow.com/questions/11348810/error-in-curl-when-authenticating-into-jira

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