invalid semicolon separator in query

问题原因:默认表单请求中带;字符是非法的(需要urlencode)。

错误示例

  1. curl localhost:8000/Execute -d '{
  2. "Component": "mysql",
  3. "ResourceId": "cdb-gy6hm0ee",
  4. "Port": 6379,
  5. "SQL": "show databases;",
  6. "UserName": "root",
  7. "Password": ""
  8. }'

修复示例

提交请求的时候需要注明ContentType,例如这里应当标明是JSON请求。

  1. curl -X POST -H "Content-Type: application/json" localhost:8000/Execute -d '{
  2. "Component": "mysql",
  3. "ResourceId": "cdb-gy6hm0ee",
  4. "Port": 6379,
  5. "SQL": "show databases;",
  6. "UserName": "root",
  7. "Password": ""
  8. }'