Try to subscribe to btcusdt@bookTicker on wss://data-stream.binance.vision:443.
Send request
{“method”:“SUBSCRIBE”,“params”:[“btcusdt@bookTicker”],“id”:1} and receive response
{“error”:{“code”:3,“msg”:“Invalid JSON: trailing characters at line 1 column 62”}}
libwebsockets write on screen before send request
What wrong I do?
Hi @achuprynov,
Your payload looks valid and the book ticker should work for BTCUSDT
pair.
Could you please ensure that your request does not contain any extra bytes, such as NULL (0x00), newlines, or other unexpected characters at the end? Try to format and log the JSON before sending it to ensure that structure is correct.
Also ensure that your data is encoded as UTF-8 before sending it.
Let us know if that helps!