我的ajax POST没有发送这样的FormData数据:
----------------------------073830197153252215545490
Content-Disposition: form-data; name="docDate"
24/11/2022
----------------------------073830197153252215545490
Content-Disposition: form-data; name="docExpDate"
30/11/2022
----------------------------073830197153252215545490
Content-Disposition: form-data; name="docType"
请改为这样发送:
[object FormData]
下面是我的POST请求的完整代码:
POST http://127.0.0.1:8088/list/addDocs_csrf=53d02b64-61ab-4456-86f1-b1b76e46536c HTTP/1.1
Host: 127.0.0.1:8088
Connection: keep-alive
Content-Length: 60
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
Accept: text/html, */*; q=0.01
Content-Type: text/plain;charset=UTF-8
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
sec-ch-ua-platform: "Windows"
Origin: http://127.0.0.1:8088
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://127.0.0.1:8088/cros/ayda/list/add-3DDF5EE0C65B09D6
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: JSESSIONID=AM3N5-IYpEEXdZJToXFUWhvXAp9mlN-LDK_ctDrC.p090wfa072093a
[object FormData]&_csrf=53d02b64-61ab-4456-86f1-b1b76e46536c
我想将FormData推送到我的控制器中,该控制器在Jboss服务器中使用Spring MVC
1条答案
按热度按时间kmbjn2e31#
也许这个能帮上忙。
下面的JavaScript实现了这个HTML表单的功能:
JavaScript程式码。
上面的JS创建了一个如下所示的标题
使用此正文: