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: