How use formData.append for a array in typescript

后端 未结 4 475
别那么骄傲
别那么骄傲 2021-01-18 06:09

Hi i want to send a form to my endpoint Profile, my problem is in the field user:{}, because i can\'t find the way to put my array into this field.

this are the fiel

4条回答
  •  醉话见心
    2021-01-18 07:02

    I had similar problem and I had declare array in key. For your example it would looks like this:

    formData.append('user[id]', body['user']['id']);
    ...
    

    It can be usefull if you wanten't or you can't parse json on server site

提交回复
热议问题