R
R
rusgayfer2017-07-21 15:17:52
In contact with
rusgayfer, 2017-07-21 15:17:52

I make a POST request to the wall.post method but it comes in encrypted text?

Here's the code. The encrypted text arrives. Changed to "Content-type: multipart/form-data" then nothing comes at all. How to fix?

$url = 'https://api.vk.com/method/wall.post';
    $params = array(
        'owner_id' => '-'.$groupId,    // Кому отправляем
        'message' => $message,   // Что отправляем
        'attachments' => $attachments,   //  Прикрепления
        'publish_date' => $timestamp, // Дата откладывания
        'access_token' => $tokenadmin,  // access_token 
        'v' => '5.67',
    );

    // В $result вернется id отправленного сообщения
    $request = file_get_contents($url, false, stream_context_create(array(
        'http' => array(
            'method'  => 'POST',
            'header'  => 'Content-type: application/x-www-form-urlencoded',
            'content' => http_build_query($params)
        )
    )));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rikcon, 2017-07-21
@rusgayfer

In what sense is the ciphertext?
Most likely your encoding is wrong.

S
Serezha, 2017-07-21
Ahen @Ahen

UPD. I wrote nonsense.
Enivey, it's not entirely clear where the $message variable comes from and why the data in this variable is after urlencode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question