I want to send a rest api to my server and the content of the data need to be a string with double quote:
data=mycontent
curl -X POST "$SERVER_ENDPOINT" \
-H 'Authorization: Bearer '"$SERVER_TOKEN"'' \
-H "Content-Type: application/json" \
--data '{"type":"TYPE1","name":"NAME1","content":"\"'$mycontent'"\"}' \
| jq;
But I get an invalid json:
{
"result": null,
"success": false,
"errors": [
{
"code": 9207,
"message": "Content-type must be application/json."
}
],
"messages": []
}
How can I format a double quote string and send it thru rest api?