javascript - Difference of using FormData and Json Array based Ajax Posting -


i wondering difference or if adabathage gained passing post data using formdata in ajax / jquery , normal json array construction.

i used formdata , see following in post every variable sent has content type , other information, necessary ? example formdata posting:

                        var form_data = new formdata();                                           form_data.append("file", file_data);                         form_data.append("fname",fname),  ==>on submit data: form_data,     e08868d6629941cdc8549f7e4b8fbe92     ------webkitformboundaryagxuglskgawzo2j7     content-disposition: form-data; name="imagefile[]"; filename="car2.jpg"     content-type: image/jpeg      ------webkitformboundaryagxuglskgawzo2j7     content-disposition: form-data; name="fname" 

json

data: {fname:"thisisfname"},  


Comments