I am trying to update an existing Confluence Page from Jenkins. I am using the below command:
curl -u username:password -X PUT -H 'Content-Type: application/json' -d @update.json https://myapp.net/confluence/rest/api/content/${PAGE_ID} | python -mjson.tool.
The update.json has the below content:
'{"id":"3884567","type":"page","title":"JenkinsBuildStatus","space":{"key":"FDRATES"},"body":{"storage":{"value":"<table><tr><td>Hello</td><td>World</td></tr></table>","representation":"storage"}},"version":{"number":"2"}}'
The update of page using the curl command fails with the below error:
{
"message": "",
"reason": "Internal Server Error",
"statusCode": 500
}
It seems the error is due to the '<' and '>' characters inside the body of update.json.
I put backslash \ in front of '<' and '>' like below and that also failed with the same Internal Server Error 500:
'{"id":"3884567","type":"page","title":"JenkinsBuildStatus","space":{"key":"FDRATES"},"body":{"storage":{"value":"\<table\>\<tr\>\<td\>Hello\</td\>\<td\>World\</td\>\</tr\>\</table\>","representation":"storage"}},"version":{"number":"2"}}'
I changed the '<' and '>' with '<' and '>' respectively:
'{"id":"3884567","type":"page","title":"JenkinsBuildStatus","space":{"key":"FDRATES"},"body":{"storage":{"value":"<table><tr><td>Hello</td><td>World</td></tr></table>","representation":"storage"}},"version":{"number":"2"}}'
With these substitutions the curl command could update the page, but in the page the content is not showing as table, instead the page is showing the HTML as text.

Please suggest how this issue can be resolved.