Last active
May 18, 2017 08:11
-
-
Save tadaken3/aa382f2e52170a0bad591edde9ce30c8 to your computer and use it in GitHub Desktop.
PythonからLINE NotifyでLINEにメッセージを送る ref: http://qiita.com/tadaken3/items/0998c18df11d4a1c7427
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:UTF-8 | |
import requests | |
def main(): | |
url = "https://notify-api.line.me/api/notify" | |
token = #ここにアクセストークンを入力します。 | |
headers = {"Authorization" : "Bearer "+ token} | |
message = 'ここにメッセージを入れます' | |
payload = {"message" : message} | |
files = {"imageFile": open("test.jpg", "rb")} #バイナリで画像ファイルを開きます。対応している形式はPNG/JPEGです。 | |
r = requests.post(url ,headers = headers ,params=payload, files=files) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment