Hi all,
I realize this is a pure freeswitch question but I have not been able to find a good forum for freeswitch. The SignalWire slack channel is just like shouting in the middle of the street hoping someone will look at you. Anyway, sorry, just venting! the actual question is: I am trying to run a simple http POST with JSON content request using curl.
However, I always get a HTTP 0 error code.
It runs without issues when I run it from the server console as:
All I can guess is that I am doing it wrong. But I do not know what exactly is it that I am doiing wrong. I have try not escaping the JSON quotes but then I get a format error, which sounds fair.
I am following the docs and some old threads I found but no indication of what the problem may be.
Any idea is very welcome.
Thanks!
I realize this is a pure freeswitch question but I have not been able to find a good forum for freeswitch. The SignalWire slack channel is just like shouting in the middle of the street hoping someone will look at you. Anyway, sorry, just venting! the actual question is: I am trying to run a simple http POST with JSON content request using curl.
Code:
myJSON = {\"k1\": v1, \"k2\": v2}
url = 'https://myapiserver.com/api/data content-type \'application/json\' post myJSON';
session:execute('curl', url);
However, I always get a HTTP 0 error code.
It runs without issues when I run it from the server console as:
Code:
curl -d '{"k1": v1, "k2": v2}' -H "Content-Type: application/json" -X POST https://myapiserver.com/api/data
All I can guess is that I am doing it wrong. But I do not know what exactly is it that I am doiing wrong. I have try not escaping the JSON quotes but then I get a format error, which sounds fair.
I am following the docs and some old threads I found but no indication of what the problem may be.
Any idea is very welcome.
Thanks!