In order to efficiently save a large and complex object as a JSON file on the server without needing to map it to an object in C# first, I am facing some challenges. Sometimes, when posting the object as a string, the data gets corrupted leading to errors during transmission.
Prior attempts to use encodeURI
and JSON.stringify
followed by HttpUtility.UrlDecode
in C# have resulted in unwanted side effects like removing pluses within dataurls for image src attributes.
Is there a method to post the object without encountering these issues? Alternatively, is there a way to receive the object in C# as a generic object that can be serialized without the need for mapping it to a class beforehand?
var data = {
workflowID: workflowToSave.ID,
jsonWorkflow: JSON.stringify(workflowToSave)
};
vm.axiosPost("/Workflows/Save", data).then((result) => {
}) ...