WebQQ

Today, I found the following problems when I was building 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 a new line character appears when getting the ptwebqq value. Trim can clear the format!
Then one code solves the problem:

 trim($ptwebqq)

It is hereby recorded.

Last modification: November 17, 2017
If you think my article is useful to you, please feel free to appreciate it