Home>
When I was practicing sending images using the LINE API, I succeeded in sending one letter and one image, but the second one was not sent. Why is this? And how can I rewrite this problem?
def send_LINE ():
token = "Ah ah ah ah ah ah ah ah ah ah"
api = "https://notify-api.line.me/api/notify"
#Create the information I want to send
send_contents = "" "
Oh Oh Oh Oh
Ah ah ah ah
"" ""
image_files = ["./chart_H1.png", "./chart_M5.png"] #Specify the image path
# Read as binary data
image_bainary_H1 = open (image_files [0], mode = "rb")
image_bainary_M5 = open (image_files [1], mode = "rb")
# Make information dictionary type
token_dic = {"Authorization": "Bearer" + "" + token}
send_dic = {"message": send_contents}
image_dic_H1 = {"imageFile": image_bainary_H1}
image_dic_M5 = {"imageFile": image_bainary_M5}
# Send a notification to LINE
requests.post (api, headers = token_dic, data = send_dic, files = image_dic_H1)
requests.post (api, headers = token_dic, files = image_dic_M5)
-
Answer # 1
Related articles
- python - i want to switch images using itemconfig in the gui, but it doesn't work
- (django) i can't post with images
- python 3x - multiple outputs from a list of tuples
- python - i can't install scikit-learn
- python - i want to download images from flickr
- python - about multiple processing and loop processing in discordpy
- ruby - [posting multiple images] the src column of the image table becomes nul
- python - typeerror when calculating the array of images called by imageopen ()
- python - read multiple audio files (wav files)
- (python) i want to convert multiple json files with different columns into one csv format
- python 3x - i can't get the text of the span tag using selenium
- display images by drag and drop on wxpython gui
- i want to display images periodically in python, what should i do?
- i want to click and number a few images like a switch in python
- python - i can't push to heroku
- python - i can't import
- python 3x - [python] i want to compare multiple dictionaries and remove duplicate dictionaries
- multiple classification score calculation errors, python, svm
- html - i can't arrange multiple images side by side with css
Related questions
- python : List of dictionaries?
- javascript : How can I get the hidden site API
- How to write script via API in Python?
- How to translate into a normal format -a date from numbers. Python
- Hello, how can I bypass recaptcha v2 on a website via python, then login to the website and create cookies?
- You need to add a hyperlink and data from api for telegram bot in python
Message is required in the request parameter specifications of the API.
As with the first time, make sure that some data is sent as a message.
LINE Notify API Document