Feb 28, 2024 12:39 PM
Hi, I don't have much experience with API requests. I am trying to understand how it all works. I am currently using Node-RED (visual Node.js) to process the requests. I was able to complete a GET request and i'm now trying to do a PATCH request to update data in Airtable.
I get the following error message when trying:
I am unsure where the API is expecting the request body.
Here is my test JSON:
Solved! Go to Solution.
Feb 29, 2024 12:50 PM
After Further investigations, It appears the request body was sent via msg.payload and not msg.req.body.
I was finally able to do my PATCH resquest.
Thank you
Feb 28, 2024 06:02 PM
You only need to include the fields you want to update in a PATCH request
Hmm, your JSON looks fine to me, hopefully someone else can spot something
For what it's worth, I used your exact JSON in Postman and it worked fine. You have a `Content-Type` set as `application/json` right?
Feb 29, 2024 06:40 AM
Yes the HTTP Request node as a custom header with Content-Type application/json, see below:
Feb 29, 2024 07:14 AM
My guess is that I am not sending the JSON to the place the API is looking for it.
I have tried multiple things:
msg.req.body, msg.request.body, msg.body, msg.request, msg.req
The issue is that I don't know where the API is expecting the JSON.
Regards.
Feb 29, 2024 12:50 PM
After Further investigations, It appears the request body was sent via msg.payload and not msg.req.body.
I was finally able to do my PATCH resquest.
Thank you