Answer the question
In order to leave comments, you need to log in
It is not possible to send a picture to the VK server via vk_api in Python. What to do?
It is not possible to get the hash and the server, because after the POST request it will not display it, but writes
RESPONSE <200>
The code itself:
elif event.text == '!тест':
data = vk.photos.getMessagesUploadServer(peer_id = event.peer_id)
upload_url = data['upload_url']
img = {'photo': ('blank.jpg', open(r'/sdcard/Download/blank.jpg', 'rb'))}
request = requests.post(upload_url, files = img)
print(request)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question