Closed joey0xx closed 5 years ago
Any update this feature being added? I'm looking to do something similar.
Was able to make it work like this:
let params = [
..........
...invitees.map((v,i) => { name: `invitees[${i}].email`, value: v.email }),
...invitees.map((v,i) => { name: `invitees[${i}].name`, value: v.email })
]
Notice this part:
{ name: `invitees[${i}].email`, value: v.email })
I havent done it with an array of strings but i guess it would be like this
const anArray: string[] = ['string1', 'string2'];
let params = [
..........
...anArray.map((str, i) => { name: `nameofstringarray[${i}]`, value: str }),
...anArray.map((str, i) => { name: `nameofstringarray[${i}]`, value: str })
]
Where are you getting the error?
Im trying to send a request to a dotnet core api and in the payload one of the properties represents an array. Im trying to send the array like this:
Also tried it like this:
Neither way works when i debug the api to see how it parses the payload. The rest of the properties which is a mix of primitive types, objects and files parse fine. Any idea on what should be the format? The array is of an object with two properties named
name
andemail
.Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
package.json
file of your project and paste your dependencies and devDependencies here)