Passing big data with spaces and characters through an API end point
I used to worry about how to trim all that with characters to normal data or clean data for storage, the solution to this problem is to make sure you inspect every step your data is being passed and see where there is a break in code.
What I did was to inspect every step the data is conveyed to make sure it maintains state and fully synthesized for storage. And sure indeed, I found where the problem was and eventually fixed. The problem was it was failing to pass nvarchar to the data type of DateTime hence breaking the insertion.