23. April 2021 10:59
HttpWebRequestMgt.Initialize('https://api.pushover.net/1/messages.json');
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetReturnType('application/json');
HttpWebRequestMgt.SetContentType('application/x-www-form-urlencoded');
HttpWebRequestMgt.AddBodyAsText('token=MeinToken&user=MeinUser&title=Test&message=123');
TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(InStr);
IF HttpWebRequestMgt.GetResponse(InStr,HttpStatusCode,ResponseHeaders) THEN
MESSAGE('Gesendet');
$uri = "https://api.pushover.net/1/messages.json"
$parameters = @{
token = "MeinToken"
user = "MeinUser"
message = "hello world"
}
$parameters | Invoke-RestMethod -Uri $uri -Method Post
23. April 2021 13:08
WebReqMgt.AddBodyAsText('{'+
' "bla1": ' + "meins" +','+
' "blub1": ' + "deins" +','+
' "ding1": ' + "seins" +
'}');
WebReqMgt.AddHeader('Content-Type','application/json');
WebReqMgt.AddBodyAsText('{'+
' "token": ' + "MeinToken" +','+
' "user": ' + "MeinUser" +','+
' "message": ' + "hello world" +
'}');
WebReqMgt.AddHeader('Content-Type','application/json');
26. April 2021 10:08
sweikelt hat geschrieben:sprich für dich ungefähr so;
CODE: ALLES AUSWÄHLEN
WebReqMgt.AddBodyAsText('{'+
' "token": ' + "MeinToken" +','+
' "user": ' + "MeinUser" +','+
' "message": ' + "hello world" +
'}');
WebReqMgt.AddHeader('Content-Type','application/json');
HttpWebRequestMgt.AddBodyAsText('{"token": "MeinToken","user": "MeinUser","message": "Testnachricht"}');
WebReqMgt.AddHeader('Content-Type','application/json');
HttpWebRequestMgt.SetContentType('application/json');
26. April 2021 12:34
HttpWebRequestMgt.Initialize('https://api.pushover.net/1/messages.json');
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetContentType('application/json');
HttpWebRequestMgt.SetReturnType('application/json');
HttpWebRequestMgt.AddBodyAsAsciiText(
'{'+
'"token": ' + '"MeinToken"' + ',' +
'"user": ' + '"MeinUser"' + ',' +
'"message": ' + '"Testnachricht"' +
'}');
TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(InStr);
IF HttpWebRequestMgt.GetResponse(InStr,HttpStatusCode,ResponseHeaders) THEN
MESSAGE('Gesendet');
IF HttpStatusCode.ToString <> HttpStatusCode.OK.ToString THEN
MESSAGE(HttpStatusCode.ToString);