Skip to main content
added 108 characters in body
Source Link
Hans
  • 1.1k
  • 7
  • 8

Please try:

socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time \n"]
message = SocketReadMessage[socket]

note the "\n" message returns a bytearray. Without the "\n" it hangs. I am not familiar with the binance API but just generally sometimes one or more carriage returns are necessary in HTTP headers.

ByteArrayToString[%]

Returns a 400 error page. I am assuming you are looking for a timestamp.

Please try:

socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time \n"]
message = SocketReadMessage[socket]

note the "\n" message returns a bytearray. Without the "\n" it hangs. I am not familiar with the binance API but just generally sometimes one or more carriage returns are necessary in HTTP headers.

Please try:

socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time \n"]
message = SocketReadMessage[socket]

note the "\n" message returns a bytearray. Without the "\n" it hangs. I am not familiar with the binance API but just generally sometimes one or more carriage returns are necessary in HTTP headers.

ByteArrayToString[%]

Returns a 400 error page. I am assuming you are looking for a timestamp.

Source Link
Hans
  • 1.1k
  • 7
  • 8

Please try:

socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time \n"]
message = SocketReadMessage[socket]

note the "\n" message returns a bytearray. Without the "\n" it hangs. I am not familiar with the binance API but just generally sometimes one or more carriage returns are necessary in HTTP headers.