1

I want to call REST API by passing json input. I have following details-

username apitoken apiurl Jsonfile

I have already tried curl -d @Metadata.json -H "Content-Type: application/json" <> --user xyz:apitoken --insecure

but i m getting null values for all the parameters in the json file. What am i doing wrong here?

1 Answer 1

1

Simple Solution would be to create a sample postman with above details then follow below steps -

  • Click on the code icon.
  • Choose cURL from the drop-down.

    There’s your cURL command

Sample curl command -

 curl -X POST \
 https://something.com/endpoint \
 -H 'Content-Type: application/json' \
 -H 'Postman-Token: 1f0fcc007739' \
 -H 'apikey: CSZftBtR0WaN' \
 -H 'cache-control: no-cache' \
 -d '{
     "Id": "5de675",
      "xxxxx": "500081"
 }'
Sign up to request clarification or add additional context in comments.

Comments

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.