I have a file called ghost.txt with the content below taken from the Ghost docs
{
"posts": [{
"title": "My test post",
"html": "<p>My post content. Work in progress...</p>",
"status": "published"
}]
}
and when I publish it using this bash script
# Create a session, and store the cookie in ghost-cookie.txt
curl -c ghost-cookie.txt -d username="user@domain.com" -d password="1234567890" \
-H "Origin: https://blog.domain.com" \
https://blog.domain.com/ghost/api/v2/admin/session/
# Read the JSON and cookie file and publish to Ghost
content=$(<ghost.txt)
curl -b ghost-cookie.txt \
-d "$content" \
-H "Content-Type: application/json" \
-H "Origin: https://blog.domain.com" \
https://blog.domain.com/ghost/api/v2/admin/posts/?formats=html
the post gets published with the title as it should but the main html body
"html": "<p>My post content. Work in progress...</p>"
is completely missing from the post that’s created.
Why would the main html be missing from the post? As far as I can tell I’ve structured everything correctly just like the examples given in the official Ghost documentation.