Hello everyone,
I work on Linux #astra31+ci49-Ubuntu with  GNU/Linux. 
On my system installed curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 
OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.7 libidn2/2.0.5 libpsl/0.20.2 
(+libidn2/2.0.5) libssh2/1.11.0 nghttp2/1.36.0 librtmp/2.3.
From this system I can get the data from some device usung console request to 
the private https server via the curl command:
 
curl -k -X GET -H 'Authorization: Bearer nokey'   
https://<IP-address>:<port>/api/ccu/online
 
I’ve found, how to get data from this server, using libcurl calls. But I need 
additionally to POST some data to this server using JSON-format.
Using console request:
 
curl -k -X POST -d ‘{«1»:0}’ -H ‘Content-type: application/json’ -H 
‘Authorization: Bearer nokey’  https://<host>:Port/api/ccu/outputs
 
I can change some output registers of the device, via this server. Is it 
possible anyhow using some options of libcurl to POST data to this device in 
JSON-format, like it is done in the previous curl console command? 
 
Thanks in advance!
--
Vladislav Korobov
--
Владислав Коробов
Отправлено из Почты  Mail
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
  • How to use libcurl to P... Владислав Коробов via curl-library

Reply via email to