I'm trying to use Binance's API. The following works:
URLExecute[ <|"Scheme" -> "http", "Domain" -> "api.binance.com",
"Method" -> "GET", "Path" -> "/api/v1/time"|>]
(* {"serverTime" -> 1519522573487} *)
but I would like to use the socket instead. I tried
socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time"]
message = SocketReadMessage[socket]
but the last command never stops (even without the WriteString
). I also tried replacing the first line with socket = SocketConnect["stream.binance.com:9443"]
, see binance doc, with the same result.
What is wrong and how can I connect to the socket to return, e.g., the server time or last orders?
Related: 26875 but does not use Mathematica's latest features and 165297.