Hi,
I need to query data via a POST request that only accepts form-data or url-encoded forms.
Is there a way to do this via Skuid?
Page 1 / 1
You can make a query using a POST request that sends data as url-encoded form data like this:
- Create a new “Inline (Snippet)” to use for the payload generation snippet, with a body like this:
return skuid.utils.param({
“foo”: “bar”,
“something”: “else”,
});
this will send properties of “foo” and “something” in the payload of the POST request, encoded as form data.
- Set the Query method of your REST Model to have the following properties:
- Request body contents: “As custom payload format in request body”
- Payload Generation Snippet: <Select the snippet that you just created in step 1>
- Payload Content Type: application/x-www-form-urlencoded
Depending on what kind of data you expect to come back from the API, you may need to change the Response Format to something other than JSON, but if the API is returning JSON, you should be good to go.
That did the trick! Thanks!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.