I am using cURL on Windows by attempting to use two shells with varying results(Powershell, Git Bash).
I want to POST a CSV string to an API. I know this API works because I have tested it in Python, however I cannot get it to work in the shell.
Example:
Powershell (Curl Version 8.0.1)
C:\Windows\System32\curl.exe -k
"https://website.com" -X POST -H "Content-Type: application/octet-stream" --data-raw $"LATITUDE,LONGITUDE\n53.3737131,-1.4704939\n53.3742428,-1.4677477\n53.3745646,-1.467576\n53.3758092,-1.4665675\n"
Git Bash (Curl Version 7.80)
$ curl -k 'https://website.com' -X POST -H 'Content-Type: application/octet-stream' --data-raw
$'LATITUDE,LONGITUDE\n53.3737131,-1.4704939\n53.3742428,-1.4677477\n53.3745646,-1.467576\n53.3758092,-1.4665675\n'
The Git Bash solution works.
The API is telling me I am missing the LATITUDE column in my CSV string. Without going into specifics on the API (since I know it works) is there something I could be missing in my curl request that is causing this CSV string to be malformed when sent?