A
A
askhatCH2019-11-08 15:50:32
JavaScript
askhatCH, 2019-11-08 15:50:32

Is it possible to send a message with a plus (+) to the VK API?

Here I want to send a request for a post using Ajax:

$.ajax({
  url: 'https://api.vk.com/method/messages.send?access_token=ТОКЕН&v=5.68&message=Ответ: 5+5=10&chat_id=1',
  method: 'POST',
  dataType: 'JSONP',
  success: function(data){
        console.log(data);
  }
});

But when sending a request, "+" is not visible. And it becomes not "5 + 5", but "55"
How to solve?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Somewhere Intech, 2019-11-09
@askhatCH

$.ajax({
  url: 'https://api.vk.com/method/messages.send',
  method: 'POST',
  data: {
    access_token: "ТОКЕН",
    v: 5.68,
    message: "Ответ: 5+5=10",
    chat_id: 1
  },
  dataType: 'JSONP',
  success: function(data){
        console.log(data);
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question