-1
curl -H "Content-Type: application/json" -X POST --data "@data.json"  http://localhost:3000/
brooksrelyt
  • 3,925
  • 5
  • 31
  • 54
Athul
  • 3
  • 1
  • 3

1 Answers1

0

curl can be used to send multiple types of content but the default of all being the application/x-www-form-urlencoded. If you need to send a file through the same , you need to put that in the header, and for putting a file you need to specify -d param for the same.

a sample use of the same can be as :

 $ curl -vX POST http://<servername>/<api>/v1/<jsonfilename.json> -d @<file.json> \
--header "Content-Type: application/json"
Vishesh
  • 167
  • 2
  • 11
  • ok. If we passed like this there should be a POST method to handle this call. what will be the signature of that? – Athul Oct 22 '15 at 08:29