[python] Line Notify
發表於 : 2022-02-07, 09:37
https://ithelp.ithome.com.tw/articles/10234115
代碼: 選擇全部
#基本功能測試
import requests
def lineNotifyMessage(token, msg):
headers = {
"Authorization": "Bearer " + token,
"Content-Type" : "application/x-www-form-urlencoded"
}
payload = {'message': msg }
r = requests.post("https://notify-api.line.me/api/notify", headers = headers, params = payload)
return r.status_code
if __name__ == "__main__":
token = '你的token'
message = '訊息測試'
lineNotifyMessage(token, message)