How to inspect FormData?

前端 未结 15 1522
悲&欢浪女
悲&欢浪女 2020-11-22 08:23

I\'ve tried console.log and looping through it using for in.

Here it the MDN Reference on FormData.

Both attempts are in this fi

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 08:25

    Easy Method

    I used this code in angular 8

    var formData = new FormData();
    formData.append('key1', 'value1');
    formData.append('key2', 'value2');
    
     formData.forEach((value,key) => {
        console.log(key+value)
         });
    
    

提交回复
热议问题