Help me to use Strapi (400 error)?

Hello,

I tried to add a post using Strapi but it keeps failing. What I did is that I tested the POST url with Postman. I have a this error appearing :

What could be the problem ?

Seems to me your not sending anything, you are sending payload and content of what ? it’s nothing in it :slight_smile: Also it might be fields that are required. So in comments what psudeo and content do you want ? :slight_smile:

Hi! Thank you very much for your answer. I tried to discuss about my code on StackOverFlow. I thought I might have done a mistake. Here is the link : reactjs - AxiosError : Request failed with status code 400 (in React JS) - Stack Overflow

Well as they said, your not actually sending any data to it. So if “data” payment is empty you are not sending any data at all

Do you have an idea how I can do this ? I’ve been trying many solutions for the last two days…

Message is clear. It says you need to provide a data object in the post request. What is the object in the request body?

Hello Majid_Hojati. :slight_smile: The object is :
Capture d’écran 2022-05-23 à 14.43.30

1 Like

Does that not need to be inside data

I tried to send the object {“data”:{“attributes”:{“pseudo”:“test”, “content”:“test”}}}, it hasn’t been added to my Strapi. At least, I don’t have error any more.

Sorry something has been added but without values.

Now, it worked. Thank you very much. :grinning: