<html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>nginx</center> </body> </html>

FormData.append () can add key-value pairs, such as formData.append ("A1", "aa"); , but now I want to change the second parameter, that is, the value, to a json object, such as FormData.append ("bbb":1: {" bbb":1}) , but when it is sent to the backend, it is always [object Object] ,
above:

:

.

I don"t know how to write this, and please give me some advice.

Mar.28,2021

I use antd to implement, while antd upload uses H5's FileReader method.
my screenshot
clipboard.png

clipboard.png
this is the principle of antd-- "upload" on the Internet: https://blog.csdn.net/Donspen.
hopes to help!


JSON.stringify (json)


  1. just add a string to JSON
  2. pay attention to whether it is legal or not. It is not possible for JSON, to insert objects randomly.

you cannot use json,. See the documentation
link
void append (DOMString name, Blob value, optional DOMString filename);
void append (DOMString name, DOMString value);

.

give a simple idea:
convert all the pictures into base64 strings, and then you can use them as much as you want.
you can post directly without FormData,.

The

problem has been resolved and can be solved using a [b] syntax. For more information, please refer to https://www.jianshu.com/p/80e.

here.
Menu