When sending an HTTP request with form values in x-www-form-url-encoded
, it becomes a simple key-pair string separated by &
characters.
So sending a form like this:
foo: bar
apple: red
Will result in the following string:
foo=bar&apple=red
Usually when sending an array, we use the same key, like this:
colors: [red, blue, green]
Becomes
colors=red&colors=blue&colors=green
But when an API expects an array in a request using this body and this type of data, is there a standard way of declaring that a property is an array with only one element, or with 0 elements?
Like this:
foo: [bar]
Or
thingsJonSnowKnows: []