Hello to All,
I managed to send a HTTP Post to Pushover...
Now only the attachment is missing! Can someone help me to implement this? At the Homepage from Pushover Pushover API i found an example in Python3
What do i have to add to my code?
Thanks
Tom
I managed to send a HTTP Post to Pushover...
HTTP Post:
Dim j As HttpJob
j.Initialize("",Me)
Dim values As Map = CreateMap ("token":"APP_TOKEN","user":"USER_KEY","device":"","title":"title","message":"hello world")
'Dekodiere Anfang
Dim sb As StringBuilder
Dim su As StringUtils
sb.Initialize
Dim first As Boolean = True
For Each key In values.Keys
If Not(first) Then
sb.Append("&")
Else
first = False
End If
sb.Append($"${su.EncodeUrl(key, "UTF8")}=${su.EncodeUrl(values.Get(key), "UTF8")}"$)
Next
sb.ToString
'Dekodiere Ende
Log ("Sende encoded Pushover:" & sb)
j.PostString("https://api.pushover.net/1/messages.json",sb)
j.GetRequest.SetContentType("application/x-www-form-urlencoded")
Now only the attachment is missing! Can someone help me to implement this? At the Homepage from Pushover Pushover API i found an example in Python3
Code for Pushover in Python3:
import requests
r = requests.post("https://api.pushover.net/1/messages.json", data = {
"token": "APP_TOKEN",
"user": "USER_KEY",
"message": "hello world"
},
files = {
"attachment": ("image.jpg", open("your_image.jpg", "rb"), "image/jpeg")
})
print(r.text)
What do i have to add to my code?
Thanks
Tom