Unmatched closing braces

Hi Guys,

I’m using curl-7.66.0-win64-mingw to try out some basic querying and am experiencing errors when using braces

Eg1

H:>curl --request POST --url http://localhost:8042/modalities/sample/query --data ‘{“Level”:“Study”,“Query”: {“PatientID”:“”,“StudyDescription”:“Chest”,“PatientName”:“”}}’
curl: (3) unmatched close brace/bracket in URL position 50:
{PatientID:,StudyDescription:Chest,PatientName:}}’
^
curl: (3) URL using bad/illegal format or missing URL

Eg2

H:>curl -v -X PUT http://10.31.194.72:8042/modalities/sample -d ‘{ “AET”: “RA600”, : “Host”: “10.52.34.51”, “Port”: 104 }’
curl: (3) unmatched close brace/bracket in URL position 1:
}’
^
curl: (3) URL using bad/illegal format or missing URL

Can anyone point me in the right direction to overcome this.

Kind Regards, David Mc

Hello

I have tried your example in bash on Ubuntu (in Windows Subsystem for Linux), and it works fine.

I have tried your example in Powershell (by replacing “curl” with “curl.exe”) and it works fine, too.

In cmd.exe, indeed, I encounter the same error.

Since this is clearly not an Orthanc problem and since I (personally) consider cmd.exe to be a dead-end, I have not investigated further.

May I thus humbly suggest that you switch to powershell.exe, if that suits your use case ? (Powershell is available by default since Windows Vista, IIRC)

(on a side note, the reason I am using curl.exe instead of a mere curl in Powershell is that the curl command is an alias for the PowerShell Invoke-WebRequest command… not a very good idea from the Powershell team in my opinion)