You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 6 Next »
invalid semicolon separator in query
问题原因:默认表单请求中带;字符是非法的(需要urlencode)。
;
urlencode
错误示例:
curl localhost:8000/Execute -d '{ "Component": "mysql", "ResourceId": "cdb-gy6hm0ee", "Port": 6379, "SQL": "show databases;", "UserName": "root", "Password": "" }'
修复示例:
提交请求的时候需要注明ContentType,例如这里应当标明是JSON请求。
ContentType
JSON
curl -X POST -H "Content-Type: application/json" localhost:8000/Execute -d '{ "Component": "mysql", "ResourceId": "cdb-gy6hm0ee", "Port": 6379, "SQL": "show databases;", "UserName": "root", "Password": "" }'