Create and post an article with spotify player using WP API

[ad_1]

I know we can create a block in the text editor we have in WordPress.
But I would like to keep it simple and just push my article using the rest API like this:

headers = {‘Content-Type’: ‘application/x-www-form-urlencoded’}

data = {

‘title’ : f'{article\_title}’,

‘content’ : f'{article\_block}’,

‘status’ : ‘publish’ #or draft

}

​

​

​

r = [requests.post](https://requests.post)(url= ROOT + ‘/wp-json/wp/v2/posts’, data=data, headers=headers, auth=(user, password))

Do you know how I kind add a spotify player in my “article\_block” variable in python ?
I can add text, and it creates a block (paragraph) but I can’t get a similar result than the specific Spotify block !

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer