Benutzer-Werkzeuge

Webseiten-Werkzeuge


dapnetapisendrubricl

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte Überarbeitung Beide Seiten der Revision
dapnetapisendrubricl [2022/01/30 13:19]
dj7lc
dapnetapisendrubricl [2022/01/30 13:22]
dj7lc [Example for python3]
Zeile 4: Zeile 4:
  
 <​code>​ <​code>​
-curl -H "​Content-Type:​ application/​json"​ -X POST -u yourcallsign:​yourpassword -d '{ "text": "this is the message", "callSignNames": ​["destinationcallsign"], "​transmitterGroupNames":​ ["​txgroup"​],​ "​emergency":​ false }' http://​dapnet.db0sda.ampr.org:​8080/​calls+curl -H "​Content-Type:​ application/​json"​ -X POST -u yourcallsign:​yourpassword -d '{ "rubricName": "rubric", "text": "this is the message" }' http://​dapnet.db0sda.ampr.org:​8080/​news
 </​code>​ </​code>​
  
Zeile 26: Zeile 26:
 </​code>​ </​code>​
  
- +===== Example for pearl =====
-Just an example in Perl from https://​github.com/​DecentralizedAmateurPagingNetwork/​DxClusterInterface/​blob/​master/​dxclusterspider_db0sda+
  
 <​code>​ <​code>​
 $c = REST::​Client->​new();​ $c = REST::​Client->​new();​
 $c->​setHost("​$dapnethost:​$dapnetport"​);​ $c->​setHost("​$dapnethost:​$dapnetport"​);​
-$c->​addHeader('​Authorization'​=>'​Basic ' . encode_base64($dapnetuser ​. ':'​ . $dapnetpw)); +$c->​addHeader('​Authorization'​=>'​Basic ' . encode_base64($yourcallsign ​. ':'​ . $yourpassword)); 
- +$c->​POST('/​news',​ '​{"​rubricName":​ "rubric", "​text":​ "'​.$message.'",​ "​number":​ '​.$pos.'​}',​ {"​Content-type"​=>'​application/​json'​});​
-$c->​POST('/​news',​ '​{"​rubricName":​ "dx-kwcw", "​text":​ "'​.$nachricht.'",​ "​number":​ '​.$pos.'​}',​ {"​Content-type"​=>'​application/​json'​});​+
 </​code>​ </​code>​
dapnetapisendrubricl.txt · Zuletzt geändert: 2022/01/30 13:27 von dj7lc