Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

invalid semicolon separator in query

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

错误示例

Code Block
languagexmlbash
curl localhost:8000/Execute -d '{
	"Component": "mysql",
	"ResourceId": "cdb-gy6hm0ee",
	"Port": 6379,
	"SQL": "show databases;",
	"UserName": "root",
	"Password": ""
}'

修复示例

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

Code Block
languagexmlbash
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": ""
}'





Panel
titleContent Menu

Table of Contents