I want to convert complex request objects to queryString like format for posting the formData with content type as x-www- form-urlencoded . My object would be of format
const obj= {
"Employee": {
"Id": 123,
"Settings": {
"StartOfDayType": [
1
],
"EndOfDayType": [
2
],
"workSettings": {
"WorkStartTime": "{\"Ticks\":288000000000,\"Days\":0,\"Hours\":8,\"Milliseconds\":0,\"Minutes\":0,\"Seconds\":0,\"TotalDays\":0.33333333333333331,\"TotalHours\":8,\"TotalMilliseconds\":28800000,\"TotalMinutes\":480,\"TotalSeconds\":28800}",
"WorkEndTime": "{\"Ticks\":648000000000,\"Days\":0,\"Hours\":18,\"Milliseconds\":0,\"Minutes\":0,\"Seconds\":0,\"TotalDays\":0.75,\"TotalHours\":18,\"TotalMilliseconds\":64800000,\"TotalMinutes\":1080,\"TotalSeconds\":64800}",
},
"StartLocation": {
"Latitude": 0.0,
"Longitude": 0.0
},
"StartAddr": null,
"EndLocation": {
"Latitude": 0.0,
"Longitude": 0.0
},
"EndAddr": null
}
}
}
I want to convert this to QueryString like format , in jquery we have $.param can't use it, but is there anything similar we can achieve the same in typescript. tries almost everything upon googling , but none of them converting complex objects . Any help would be much appreciated . Thank you