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
Dim files As List
files.Initialize
Dim fd1 As MultipartFileData
fd1.Initialize
fd1.KeyName = "Abbey"
fd1.Dir = File.DirAssets
fd1.FileName = "abbey.jpg"
fd1.ContentType = "image/jpg"
files.Add(fd1)
Log ("Sende encoded Pushover:" & sb)
j.PostMultipart("https://api.pushover.net/1/messages.json",sb, files)
'j.PostString("https://api.pushover.net/1/messages.json",sb)
j.GetRequest.SetContentType("application/x-www-form-urlencoded")