curl --basic -u -X -H -d
--basic
:指定简单密码校验-u
:指定用户名和密码,格式:username:password
-X
:指定请求方式-H
:指定header
,例如:application/x-www-form-urleoded
或者Content-Type: application/json
-d
:指定参数
application/x-www-form-urleoded
注意:参数进行url
编码
curl --basic -u iot:iot -X POST -H "application/x-www-form-urleoded" -d 'tslJson=%7B%22%5D%7D&productId=11529' http://192.168.0.1:8080/test
application/json
curl -H "Content-Type: application/json" -X POST -d '{"user_id": "123", "coin":100, "success":1, "msg":"OK!" }' http://192.168.0.1:8080/test