Search this site
Embedded Files
Post 2 Push
  • Home
  • Privacy Policy
Post 2 Push
  • Home
  • Privacy Policy
  • More
    • Home
    • Privacy Policy

Post 2 Push

Examples for sending a post request to the phone

  • For HTTP and HTTPS
  • The examples assume you keep the default settings (for accepted params and ports)

Javascript

  • make sure to visit the webpage first to allow the untrusted cert)
  • HTTPS needed for same-origin policy
function postRequest(url, text){
    var xhr = new XMLHttpRequest();
    xhr.open('POST', url)
    xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    xhr.send(text);
}
postRequest('http://192.168.1.13:8080', ‘title=hello&text=world’);
postRequest('https://192.168.1.13:8443', ‘title=hello&text=world’);

Python 3

  • HTTPS not really needed
import requests
r = requests.post('http://192.168.1.13:8080', data={'title':'hello','text':'world'})
r = requests.post('https://192.168.1.13:8443', data={'title':'hello','text':'world'}, verify=False)

Note:

HTTPS is not secure, only for Javascript because of the same-origin policy (at least until I add a custom keystore feature)

More Ways for Automation

Repeated Notifications

accessibility → notification reminder

Log Notifications to see previous notifications

Use automation app such as Tasker, MacroDroid

Alternative apps: Pushbullet can send notifications from desktop to phone but uses a third party


Google Sites
Report abuse
Google Sites
Report abuse