Answer the question
In order to leave comments, you need to log in
How to make a get request to vk api in PHP?
How to write a get request?
here in python with the requests library like this
zapros = get("https://api.vk.com/method/groups.getLongPollServer?group_id={0}&access_token={1}&v={2}".format(mygroupid,secret_token,'5.95'))
Answer the question
In order to leave comments, you need to log in
But curl extension must be enabled in php.ini
$queryUrl = 'https://api.vk.com/method/groups.getLongPollServer';
$queryData = http_build_query(array(
"group_id" =>123,
"access_token"=>321,
"access_token"=> 333
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_POST => 0,
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $queryUrl,
CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question