I am trying to invoke the curl command in powershell and pass some JSON information.
Here is my command:
curl -X POST -u username:password -H "Content-Type: application/json" -d "{ "fields": { "project": { "key": "key" }, "summary": "summary", "description": "description - here", "type": { "name": "Task" }}}"
I had smoothing errors and "inconsistent brackets", and the host could not be resolved, etc.
Then I tried the double quote prefix in the line with the return line character, but could not recognize the character - in the json description field
thanks
EDIT 1:
When I wrote the curl command in a regular batch file, I used double quotes and no single quotes. Also, on the -d line, I avoided all double quotes with \ , and the command worked.
In this case, my curl actually points to curl.exe. I indicated the path, just did not list it here. I also tried adding single quotes around -d , and I got:
curl: option -: is unknown curl: try 'curl --help' or 'curl --manual' for more information
It looks like it can't recognize the character - in JSON
source share