The answer to my problem was given out by @meuh "If you want curl to send the contents of a file, and not just the filename, you would need -d @filename but tilde ~ will not be expanded so use -d @$HOME/Desktop/testFile.json". Thank you for your quick help.
If you want
curlto send the contents of a file, and not just the filename, you would need-d @filenamebut tilde~will not be expanded so use-d @$HOME/Desktop/testFile.json