你可以试试这个。我已经用单引号替换了双引号。
curl -H "Accept: application/json" -X POST -d 'method=login&input_type=JSON&response_type=JSON&rest_data={"user_auth":{"user_name":"admin","password":"21232f297a57a5a743894a0e4a801fc3"},"application_name":"dummy"}' http://localhost:8888/SugarCE-Full-6.5.15/service/v2/rest.php
样本输出为:
{
"id": "dc67f918eb13843fbc7446ed4e3e4cf0",
"module_name": "Users",
"name_value_list": {
"user_currency_id": {
"name": "user_currency_id",
"value": "-99"
},
"user_currency_name": {
"name": "user_currency_name",
"value": "US Dollars"
},
"user_id": {
"name": "user_id",
"value": "1"
},
"user_language": {
"name": "user_language",
"value": "en_us"
},
"user_name": {
"name": "user_name",
"value": "admin"
}
}
}