Home python Error & lt; Response & gt; Python vk_api

Error & lt; Response [200] & gt; Python vk_api

Author

Date

Category

I write a program on Python to ladt posts with the image to the VK group. I use the VK_API and Requests library.
Actually, the program itself:

import vk_api
Import Time.
Import Random
Import DateTime.
Import Requests.
token = 'user token (access to wall and photos)'
group_id = id group
vk = vk_api.vkapi (token = token)
gwus = vk.method ('photos.GetWalluploadServer', {'group_id': group_id})
album_id = gwus ['album_id']
user_id = gwus ['user_id']
Upload_URL = GWUS ['upload_URL']
File = {'Photo1': Open ('Q.PNG', 'RB')}
Ur = Requests.post (Upload_URL, Files = File)
Print (UR)

When starting displays

response [200]

.
How can this be fixed?


Answer 1, Authority 100%

This is not an error, this is a successful result (see List of HTTP status codes ). To get the answer text, you need to take the Text field, for example:

print (ur.text)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions