This example is for the case where fileData is very huge and in json format
let map = new Map<string, string>()
map.set(this.getFilename("filePath"), JSON.stringify(fileData));
map.set("second.xml", JSON.stringify(fileData));
let jsonObject = {};
map.forEach((value, key) => {
jsonObject[key] = value
});
console.log(JSON.stringify(jsonObject))
we can pass this JSON.stringify(jsonObject) to the API which accepts hashmap in its request body
How to pass a simple HashMap to the backEnd API
JsonMap will be a simple map which contains some key and a value like
"testData" : "30"
"sampleData" : "40"
And finally while posting in the request body we stringify and then send the map