0

I have been hitting a curl command with queryparametr in the request and passing a json format in the query parameter , but I am getting error like (" some well formatted json in parameter query.unexpected character encountered parsing error while parsing value .

curl -g --request GET -H "Content-Type:application/json" -H "apitoken:abcd" "https://odat.abc.com/api/data?query=$(echo '$jsonInput')"

jsonInput is the json format file we are passing here.

Deepak
  • 1
  • 2

1 Answers1

0

See https://stackoverflow.com/a/32980082/1395722

curl -G --request GET -H "Content-Type:application/json" -H "apitoken:abcd" "https://odat.abc.com/api/data" --data-urlencode "query=$(echo $jsonInput)"
a.l.
  • 1,085
  • 12
  • 29