如何将带有 FormData 的地图对象发送到 .NET API?
How to send a Map Object With FormData to .NET API?
当我尝试发送带有 FormData 的地图对象时,出现类似这样的错误;
TS2345: Argument of type 'Map<number, number>' is not assignable to parameter of type 'string | Blob'. Type 'Map<number, number>' is missing the following properties from type 'Blob': type, arrayBuffer, slice, stream, tex
我如何将带有表单数据的对象发送到我的 .net API?
转换为json并像这样发送
var content = '{ json data here }';
var blob = new Blob([content], { type: "text/json"});
formData.append("jsonData", blob);
或
new Blob([JSON.stringify({
description: 'description',
})], {
type: 'application/json'
})
当我尝试发送带有 FormData 的地图对象时,出现类似这样的错误;
TS2345: Argument of type 'Map<number, number>' is not assignable to parameter of type 'string | Blob'. Type 'Map<number, number>' is missing the following properties from type 'Blob': type, arrayBuffer, slice, stream, tex
我如何将带有表单数据的对象发送到我的 .net API?
转换为json并像这样发送
var content = '{ json data here }';
var blob = new Blob([content], { type: "text/json"});
formData.append("jsonData", blob);
或
new Blob([JSON.stringify({
description: 'description',
})], {
type: 'application/json'
})