Python

Python - httpclient

import http.client
​
conn = http.client.HTTPSConnection("pickyassist.com")
​
payload = "{\"token\":\"c2a0b6221c5dd55ceb09ae1f74e46521756d\",\"priority \":0,\"application\":\"2\",\"sleep\":0,\"globalmessage\":\"\",\"globalmedia\":\"\",\"data\":[{\"number\":\"1212\",\"message\":\"Test\"}]}"
​
headers = {
'content-type': "application/json"
}
​
conn.request("POST", "/app/api/v2/push", payload, headers)
​
res = conn.getresponse()
data = res.read()
​
print(data.decode("utf-8"))

Python - Request

import requests
​
url = "https://pickyassist.com/app/api/v2/push"
​
payload = "{\"token\":\"c2a0b6221c5dd55ceb09ae1f74e46521756d\",\"priority \":0,\"application\":\"2\",\"sleep\":0,\"globalmessage\":\"\",\"globalmedia\":\"\",\"data\":[{\"number\":\"1212\",\"message\":\"Test\"}]}"
headers = {
'content-type': "application/json"
}
​
response = requests.request("POST", url, data=payload, headers=headers)
​
print(response.text)