当我像这样提供值时,它可以正常工作:
但如果我这样提供它:
但是下面的代码无法工作,会产生400错误:
curl --silent \ --insecure \ -X POST \ -d '{"Name" : "Vikram"}' \ -H "Content-Type: application/json" \ $restUrl
但如果我这样提供它:
post="'{\"Name\" : \"Vikram\"}'"
echo $post // Prints '{"Name" : "Vikram"}'
echo ${post} // Prints '{"Name" : "Vikram"}'
但是下面的代码无法工作,会产生400错误:
curl --silent \ --insecure \ -X POST \ -d ${post} \ -H "Content-Type: application/json" \ $restUrl