1
I just cannot understand why all my attempts failing. I try to use curl to send POST request with json to specific url when a path to JSON defined as variable:
#!/bin/sh
JSON_TMP=/home/aaa/jsons/make_6h_from_1h.json
curl -X POST -H "Content-Type: application/json" --data-binary "@${JSON_TMP}" http://some-url
Whatever I tried (putting "@${JSON_TMP}"
or "@$JSON_TMP"
or @"${JSON_TMP}"
or whatever else) just does not seems to work!
What is more annoying is that there are no any error messages or something - I just run command and get prompt back again. On other end I can see that no json was sent.
Were you trying to use JsonPath in your url? – IgorGanapolsky – 2018-04-27T13:53:21.893
"just does not seems to work" - is there an error on the server side? What about the query doesn't work? Does
-v
give you more information? – Attie – 2020-02-09T15:05:20.867