Perfect solution to webqq protocol error occurred
· Memo notes · 0 comment · 1,280 Views

Perfect solution to webqq protocol error occurred

· Memo notes · 0 comment · 1,280 Views

 WebQQ

Today, I found the following problems when I was making a robot based on webqq protocol:

 Error occured:
{{case_ clause,{invalid_ json,"lexical error: invalid char in json text.\n"}},
[{application_ util,invoke,3},
{api_ web,loop,2},
{mochiweb_ http,headers,4},
{proc_ lib,init_ p_ do_ apply,3}]}

The reason is that when getting the ptwebqq value, a newline character appears. Trim can clear the format!
Then a code solves the problem:

 trim($ptwebqq)

It is hereby recorded.

Add a new comment