I am try to access the remote RESTful Services API using cURL, the query string parameter has a JSON value. My cURL command like:
curl -g -i 'http://localhost:8080/context/restdev/employees/?q={"deptno":{"$lte":20}}'
If I enter the URL in the Chrome, I can get the data back. My cURL command gets: The URI is not well-formed, reason: Illegal character in query at position: 48
Your query
q={"deptno":{"$lte":20}}'
needs to be percent encoded. cURL supports that with the --data-urlencode switch, so try this (one line):
curl -G -i "http://localhost:8080/context/restdev/employees/"
--data-urlencode 'q={"deptno":{"$lte":20}}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With