I have tried the same thing mentioned in it and I am getting below error message.
{
"data": {
"code": "rest_cannot_create",
"message": "Sorry, you are not allowed to create posts as this user.",
"data": {
"status": 401
}
},
"headers": {
"Allow": "GET"
},
"status": 401
}