if I use nodejs like this, the article publishes correctly:
payload = {
posts: [{
title: "My test post",
html: "<p>My post content. Work in progress...</p>",
status: "published"
}]
};
response = await axios.post(urlInsert, payload, { headers })
if I use python it doesn’t work, the post isn’t even written:
post_data = {
"posts": [{
"title": "My test post",
"html": "<p>My post content. Work in progress...</p>",
"status": "published"
}]
}
response = requests.post(url, headers = headers, json = post_data)
if instead I use draft the post is written, but obviously it is not published with python:
post_data = {
"posts": [{
"title": "My test post",
"html": "<p>My post content. Work in progress...</p>",
"status": "draft"
}]
}
response = requests.post(url, headers = headers, json = post_data)