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
dapnetapisendrubricl [2022/01/30 13:22]
dj7lc [Example for python3]
dapnetapisendrubricl [2026/01/30 14:08] (aktuell)
dj7lc Fix urls
Zeile 2: Zeile 2:
  
 ===== Example for curl from linux console ===== ===== Example for curl from linux console =====
 +
 +===== HAMNET =====
  
 <​code>​ <​code>​
-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+curl -H "​Content-Type:​ application/​json"​ -X POST -u yourcallsign:​yourpassword -d '{ "​rubricName":​ "​rubric",​ "​text":​ "this is the message"​ }' http://​dapnet.db0sda.hamnet.radio:8080/news 
 +</​code>​ 
 + 
 +===== INTERNET ===== 
 + 
 +<​code>​ 
 +curl -H "​Content-Type:​ application/​json"​ -X POST -u yourcallsign:​yourpassword -d '{ "​rubricName":​ "​rubric",​ "​text":​ "this is the message"​ }' http://​hampager.de/​api/news
 </​code>​ </​code>​
  
Zeile 13: Zeile 21:
 import requests import requests
  
-url = '​http://​dapnet.db0sda.ampr.org:​8080/​news'​+# HAMNET 
 +url = '​http://​dapnet.db0sda.hamnet.radio:8080/​news'​ 
 + 
 +# INTERNET 
 +#url = '​http://​hampager.de/​api/news'
  
 headers = {'​Content-type':​ '​application/​json'​} headers = {'​Content-type':​ '​application/​json'​}
Zeile 33: Zeile 45:
 $c->​addHeader('​Authorization'​=>'​Basic ' . encode_base64($yourcallsign . ':'​ . $yourpassword));​ $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":​ "​rubric",​ "​text":​ "'​.$message.'",​ "​number":​ '​.$pos.'​}',​ {"​Content-type"​=>'​application/​json'​});​
 +</​code>​
 +
 +===== set a specific position for the skyper rubric content =====
 +
 +Valid positions are integers as char from 1 to 10
 +<​code>​
 +{ "​rubricName":​ "​rubric",​ "​text":​ "this is the message",​ "​number":​ position }
 </​code>​ </​code>​
dapnetapisendrubricl.1643545346.txt.gz · Zuletzt geändert: 2022/01/30 13:22 von dj7lc