Vishnu Ranganathan Vishnu Ranganathan - 1 month ago 5
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

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.

Comments