Почему axios post запрос возвращает ошибку 400?

const URL = 'http://localhost:1337/api';
const token = localStorage.getItem('kobza-jwt');

export async function postArticle(){

    const config = {
        headers: {Authorization:`Bearer ${token}`}
    };
    const bodyParameters = {
        body:{
            title:"test1",
            body:"test2",
        }
    };

    await axios.post(`${URL}/articles`, 
        bodyParameters,config)
    .then(console.log("well done"))
    .catch((error)=>{
        console.log('An error occurred:', error.response);
    });
}

Помогите найти ошибку. Ссылка рабочая, get запрос проходит без ошибок. Сзади у меня Strapi.


Ответы (0 шт):