add author name

This commit is contained in:
Valentin CZERYBA 2023-03-28 16:43:56 +02:00
parent dc0fd0c781
commit d96d38e508

View File

@ -117,7 +117,7 @@ if __name__ == '__main__':
print("Article ajoute : {0}".format(result["title"]["raw"]))
print(comment_post)
for i in comment_post:
data = {"post": result["id"], "content": i["content"], "date": i["date"]}
data = {"post": result["id"], "content": i["content"], "date": i["date"], "author_name": i["author"]}
page = requests.post("http://localhost:8080/wp-json/wp/v2/comments", auth=basic, data=data)
print(page.status_code)
if page.status_code == 201: