我有一些代码:
var formData = new FormData(eForm);
var xhr=GetXMLHttpRequest();
xhr.open('POST', surlAjax,false);
xhr.send(formData);
当我在 chrome 中查看请求有效负载时,我看到:
请求有效载荷
------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; 名称=“答案”
1 ------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; 名称="idSlide"
11 ------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; 名称="sEnduser"
ceff69eabdcd494de62b110c0c7231aa ------WebKitFormBoundary2Sol1RjAh9VTx3uj--
当我在 Safari 中查看请求有效负载时,我看到:
请求有效载荷
------WebKitFormBoundary3rBEoL5qcra4nVCd--
eForm 对象是一个 HTMLFormElement 对象,它是 FormData 的构造函数所需要的。
任何想法为什么请求有效负载在 safari 和 chrome 中会有所不同?