POSTMAN POST - Create
This Create is not as simple as the GET request as it requires authentication, as does the Update and Delete methods. As shown below:
Creating a post is as simple as below after there is authentication. Sending the below data to the server will create the post.
Using JSON Basic Authentication Plugin with WordPress from Github found here https://github.com/WP-API/Basic-Auth, I am able to authenticate via my user/pass to give access to Create/Update/Delete.
I have blacked out the username/password data in the screenshot, mainly because I don’t want to give out the username or the amount of characters for the password. Upon submitting the above screenshot it has now created the post as shown below:
The problem with this however, is there is no option for images so there is no featured image attached which allows the users to create a post with the featured image. This can also be added by using the WP Rest API to add an image to the route /wp-json/wp/v2/media. This allows the developer to select form-data and file from the key value pair to add an image to the media library.
The above image is Posted into the media library but it does not attach the media image to the post. I would need to edit the post to be able to do this so I will do this with the Update section.