Answer the question
In order to leave comments, you need to log in
How to "pack" a request to the VK API?
There is some request to the VK API.
The URL is:
https://vk.com/dev/wall.post?params[owner_id]=-1&p...
How to correctly "pack" such a url so that the code is readable and the request parameters are easily changed.
I tried something like:
url = 'https://vk.com/dev/wall.post'
params = {
'owner_id': '-1',
'friends_only': '0',
'from_group': '1',
'message': 'Test',
'signed': '0',
'mark_as_ads': '0',
'close_comments': '0',
'mute_notifications': '0',
'v': '5.101'
}
r = requests.post('https://vk.com/dev/wall.post', params=params).url
Answer the question
In order to leave comments, you need to log in
To work with the VK API, there is the vk_api library. Or are you reinventing the wheel?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question