JonL
February 6, 2021, 12:27pm
1
I could be missing some coffees today but I can’t find for the love of god how to send a json in the body of the post for an API form.
In other words. How do I set the payload for an API form POST?
There is a difference in behaviour between the API action and the API form.
The API action can set the payload via dmx-data:q="'value'"
But this is not implemented in the API form, missing from the UI and/or not documented.
George
February 6, 2021, 7:14pm
2
Well API form is for submitting form data only.
If you want to submit json just use tge API Action indeed.
JonL
February 6, 2021, 7:25pm
3
Thanks George.
The json option in the api form should probably be removed then as it’s misleading. It can be selected in the UI.
George
February 6, 2021, 8:23pm
5
Ah you mean the post data type. Well on API Form you can specify indeed how do you any the form posted, as regular form data or as json data.
JonL
February 6, 2021, 8:35pm
6
Yes.
But how?
There is no place in the UI to define the json payload/body for the post.
API action:
API Form:
I believe the “input data” is missing from the API Form when JSON is selected.
George
February 6, 2021, 9:39pm
7
API Form, just as Server Connect Form are components that work on any html form element.
So they submit the input fields of that html form as data. So you don’t have to specify any data - it uses the existing html input fields that are placed in the html form.
1 Like
JonL
February 6, 2021, 9:52pm
8
Oh Ok. So Api Form extends Server Connect Form. Understood.
1 Like