cURL command errors in Windows Terminal

If you're getting syntax errors when using cURL with Windows Terminal, ensure that you have escaped your code.

For example:

curl -X POST --data {"api_key": "79bba494ae076c9d51029fc819dc0a10","data": {"item": [{ "text": "Visitors","value": 4223},{"text": "ABC","value": 238}]}} -H "Content-Type: application/json"

Becomes:

curl -X POST --data {\"api_key\": \"79bba494ae076c9d51029fc819dc0a10\",\"data\": {\"item\": [{ \"text\": \"Visitors\",\"value\": 4223},{\"text\": \"ABC\",\"value\": 238}]}} -H "Content-Type: application/json"
Was this article helpful?

Awesome! 👍  Thanks so much for your feedback!