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.

1 Answer 1

1

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)"
Sign up to request clarification or add additional context in comments.

6 Comments

when i try this, iam getting Missing query parametr error , i think for this the query parameter should be along with endpoint with a ? .is there any other [email protected].
--request GET is superfluous in this command line
@Daniel , didnt get you
can somebody pls help me
@Deepak Would you mind to offer an right request sample, like 'GET /xxx?xx=dfdd'
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.