0
curl.exe -k -H "Token:THisisarealtoken123" -H "Content-type:application/json" "https://api.deftesla.com/data_export" -X POST  '{
    "status" : ["sudan"],
    "export_settings" : {
        "format": "json",
        "model": "modelX"
    }
}'

getting unexpected token at '{\n status : [sudan],\n export_settings : {\n format: json,\n model: modelX\n }\n}'"}

I've tried having it one line and still same error just no \n are in the error message. Am I forgetting a ' or " somewhere?

273K
  • 29,503
  • 10
  • 41
  • 64

1 Answers1

0

Add a -d flag before the post data and check. The syntax error disappears for me.

curl -k -H "Token:THisisarealtoken123" -H "Content-type:application/json" "https://api.deftesla.com/data_export" -X POST -d '{
    "status" : ["sudan"],
    "export_settings" : {
        "format": "json",
        "model": "modelX"
    }
}'

Helpful link to know more about the -d flag: What does the -d in this cURL command mean?