Vishnu Ranganathan Vishnu Ranganathan - 1 year ago 87
JSON Question

how to make a post call in json using curl command?

I have tried get call using curl command

"curl https://:2376/images/json" i got responce

now i am trying to create a container for that I need to make a post call using curl, i need to give the parameters or input using Json how to make this call ?

Answer Source

Assuming you are asking how to format a curl POST request with JSON attributes.

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d "{'json':{'key':'value'}}" http://your.domain/endpoint/here

This page covers a lot of useful cases.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download