curl in windows - how do i put a space in the json?
curl, json, windows
Solution
Use double quotes " and use %20 in url
Just tried on my windows command prompt now. You were missing escape on the DATA part
Your code
curl --insecure -g -X POST -H "Content-Type: application/json" -d {\"from\":\"someName\",\"message\":\"this is a message\"} https://some/website/here
should be escaped like this
curl --insecure -g -X POST -H "Content-Type: application/json" -d "{\"from\":\"someName\",\"message\":\"this is a message\"}" https://some/website/here
Problem
so i have this curl request (running on a windows cmd prompt): ``` curl --insecure -g -X POST -H "Content-Type: application/json" -d {\"from\":\"someName\",\"message\":\"this is a message\"} https://some/website/here ``` When i run this, i get an error: ``` curl: (6) Could not resolve host: is; Host not found curl: (6) Could not resolve host: a; Host not found curl: (6) Could not resolve host: message; Host not found ``` Which seems to be because the json is munged up - the spaces are not working! How would i send this message, if i wanted spaces to be in the, uh, message?