REST API body is lost

Body is lost when POST request execute.

Deployed API is return simply request body.
Is this POST request is incorrect?

1 Like

@daichi Unfortunately I canā€™t know if this request is correct or not since you are using some third party API to call the REST API so I canā€™t help you.

What exactly is your issue? I see that the request is successful because the server responded with 200 status which means success.

@JetTeam
Thank to response

The api will return recieved request body.
bellow is example

curl --location --request POST 'https://****' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "test pickup"}'

response is

 {"name":"test pickup"}

status code ā€˜201ā€™ had been expected.
but it had should return {ā€œnameā€:ā€œtest pickupā€} instead of {} on jet admin Rest.

@daichi What makes you think the serverā€™s response should be like that? In any case, you can run the same request through Postman to be sure.

The reason is specification of this api.

former is from postman
later is from Jet Admin

Why is it different result with request by postmanā€™s one?

the request body log retrieved by CloudWatch Event.
first one is from postman, others is Jet Admin

Iā€™m sorry for the poor explanation.

@daichi please share cURL here or in personal messages.

Iā€™m sorry.

How do I send personal messages?
Itā€™s not seems to find out message button to you.

@daichi Click on my profile :slightly_smiling_face:

@JetTeam
I canā€™t find the message button or mail address :thinking:

@daichi Use this email then: denis.platonov@jetadmin.io

1 Like

Iā€™m encountering the same issue with POST or PATCH

Can confirm, JSON on POST BODY does not send to an REST API.

Using Node.js & Express

Console logged req.body, req.query, and req.params all empty. I even logged the entire req object and none of the parameters are sent.

I am having to use Form Data, which is a pain.

3 Likes

Hello @hlp-cbruce @aspurlock
Could you please share more tech info? A quick loom explanation video would be appreciated.

@JetTeam

Setup a node.js server with express.

simple route to test:

app.post('/test-post-data', async (req, res) => {
  console.log('body', req.body) //This is where POST data comes in, but it's empty
  console.log(req) //Dumping all of the request object shows no data was received from jetadmin
});

We face the same issue => JSON Body is not being sent in POST (and PUT) requests.
Simple post request to our rest api works in postman and everywhere else, but not in JetAdmin.

If we use ā€œForm Dataā€ and pass the same values in there, the post request works fine.

Any chance this bug will be fixed sometime soon? :frowning:

Has this issue been resolved? Iā€™m experiencing the same issue with POST request (JetAdmin sends empty body) and its difficult to continue using the product without this ability

This works for me now. My issue was not setting the ā€˜content-typeā€™ to ā€˜application/jsonā€™ in the request headers.

1 Like