如何在Ansbile中使用POST
curl -k -X POST -H "Accept:application/json" -H "Content-Type:application/json"-u user:A231212123432 "https://www.example.com"
请求正文
{
"a":"1"
"b":"2"
"c":"3"
}
答案 0 :(得分:0)
根据docs,它可以这样工作:
- url: https://www.example.com
method: POST
user: user
password: A231212123432
HEADER_Content-Type: "application/json"
body: '{ "a":"1" "b":"2" "c":"3" }'