Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14126

How do I assign attachments file to create post using Wordpress REST API in python?

$
0
0

I use this tutorial 1 ,tutorial 2 and create new posts in python code, with below json:

    post = {'title'    :  title, 'status'   : 'publish', 'content'  :  'Hello this is content of my post.','categories': 5, # category ID'date'   : '2020-01-05T10:00:00',    }

The code work well done. The code create new post with content Hello this is content of my post. .

But I want add three PDF file(uploaded) to content new post.

I known file 1.pdf id is 324, file 2.pdf id is 325, file 3.pdf id is 326.

How can I attach three PDF file uploaded to new post?


Viewing all articles
Browse latest Browse all 14126

Trending Articles