With the request:
curl -i -u pvserver:XXXXXXX 'http://192.168.2.42/api/login.json'
I have this output
{"salt":"uTxYWQDc9lWwsuHBRfkuTzJYG5M=","session":{"sessionId":2748768190,"roleId":0},"status":{"code":0}}
Now I want to send the following request to the server:
curl -X POST \
'http://192.168.2.42/api/dxs.json?' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-encoding: gzip, deflate' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'authorization: Basic cHZzZXJ2ZXI6VjZUNUJYSDI=' \
-H 'cache-control: no-cache' \
-H 'content-type: text/plain' \
-H 'cookie: language=en_GB' \
-H 'origin: http://192.168.2.42' \
-H 'referer: http://192.168.2.42/' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36' \
-b language=en_GB \
-d '{"dxsEntries":[{"dxsId":33556247,"value":95}]}'
which will work only if I include the received session ID, but I cannot copy and paste the ID as this is an automated process, part of a script, running every 6 seconds and getting the data "value" value from another server.
I have tried the curl -c and -b options but it appears to me they are not working as, using the browser development tool shows, the session ID does come in as a cookie.