Setting processData to false means that the transmitted data will not be processed and will be sent directly to the server. If set to true, the transmitted data will be processed, usually converted into a string in URL format. Usually when using FormData to transmit form data or binary data, processData is set to false, because these data have been specially processed and do not need to be converted. When transmitting data in JSON format, you need to set processData to false, otherwise the JSON format string will be converted into URL format, causing the server to fail to parse it correctly.
In the absence of special settings (such as the ajax example above), the return value will be text type, which is a simple string, and you need to use the JSON.parse function to convert it into a json object.
Today's controllers are very smart and will automatically use the name of the formdata value to correspond to the name of the incoming parameter. Basically, files are connected using IFormFile, and other files nepal whatsapp phone number are connected using string without any problems.
Ajax example picture
in conclusion
In fact, the ajax type of formdata is widely used. Basically, other writing methods and type transmission methods of ajax can also be implemented using the formdata transmission mode. So in fact, this method is more versatile to record, and you can even write it in a format you are used to. It saves time in connecting the front and back ends. Although you can get examples of keywords on the Internet now, and there are hundreds of ways to write them, I think that understanding the meaning and operation mode of each commonly used parameter will help you solve the problem when a few bugs occur. Find out why.
Tags:
ajaxFormData objectjQueryFront-end and back-end serial connection