Forum Discussion
M language how to get this header to work?
- 5 years ago
That's not how POST works in Web.Contents()
Content: Specifying this value changes the web request from a GET to a POST, using the value of the option as the content of the POST.
Thank you for the reply, Is Content what you are wanting out of the request? If so when running this curl command
curl -X POST 'URL' \
-H 'Authorization: Bearer KEY' \
-H 'Version: 2021-08-16' \
-H "Content-Type: application/json" \I get this
Is there a way to grab the entire object to then go through it? or Can I just grab "results"? Ive tried to write the payload but haven't been able to get it to work. Thank you again
No, Content are the form fields (if you want) that you are adding to the request, not as URL parameters but as a payload in the body.
In your case you seem to want to run a POST without having an actual payload. You could specify a fake payload or switch your request to GET.
- JackSoderstrom5 years ago
Helper I
Yeah, the POST request isn't sending any data it is just getting data but needs the "-X POST" to work. What type of Dummy payload would work? https://developers.notion.com/reference/post-database-query
This is the request if you are wanting more context. Im not sure why they don't just have this as a GET request but it is POST