I am trying to use wix-http-function to insert some data into a collection - which includes a date field. My url looks like :
https://user.wixsite.com/mysite/_functions/myFunction/John/Doe/31/01/1993
The fields in my collection are firstname, lastname and birthday. As you can see the ‘/’ in date is considered a new field by wix and is inserting only 31 in date field. How do I fix this.
Hi Sam,
Welcome to the Wix Code forum.
Doing a search, there are a number of encoding techniques, but none of them seem to be reliable (i.e. predictable) enough. I would suggest changing the delimiter to a dash ‘-’ as a way to bypass the problem.
I hope this helps,
Yisrael
And how about if I need to supply data to a boolean field or a field requiring currency ? Since wix api is not understanding url encoded data, is there any alternative ? is this a bug ?
Hi Sam,
Check out query parameters
The request will be structured as follows, with an ampersand for each new parameter.
https://user.wixsite.com/mysite/_functions/myFunction /john/doe?requireCurrency=true&date=02-03-2018