I am using PowerShell in Windows 10 and have been able to use curl to issue a query and return a series of named parameters (patient name).
I want to issue a POST command on these series of named parameters so I can send all to a specific modality, but the “multiple” is tripping me up. I can issue the POST command on a single one of the parameters, but not on the entire series of them.
So I get my patient name by typing
curl.exe -u username:password http://site.url.8042/patients
That gives me a screen output, or I can output to a text file by appending > c:\directory\patients.txt
So I have the series of named parameters and if I do only one it works fine:
I don’t need quotes or brackets, which I think is what is tripping me up.
curl.exe -u username:password -X POST http://site.url:8042/modalities/MCTEST/store -d 6a3eb7c4-a9d83950-24d36e94-5c20d248-0b5ce989
So when I want to do multiples, the command I’m using within powershell is
curl.exe -u username:password -X POST http://site.url:8042/modalities/MCTEST/store -d ‘[“6a3eb7c4-a9d83950-24d36e94-5c20d248-0b5ce989”,“8c93b430-757278ab-21ab643c-c98aa03d-da14148e”,“b8f648fa-175de243-de76b1c0-2dc7551a-928b86a5”,“c865b966-f0c7d2c2-0a1114e0-80531305-31cd104e”,“aac7f73f-fcb922ef-b950c4c1-ee1d512e-e2aeb5ae”]’
I’ve tried subbing the double quotes with a backslash, tried adding a backslash, I’ve tried everything i can think of…I’m missing something.
I get a response of “must provide a json value” I’m not sure what my error is in my syntax. Any ideas?