New in 2.4: Test runs you can trust See what's new →

WebSocket

Endpoint uji WebSocket: /ws/echo mengembalikan setiap pesan teks atau biner; kirim "close" untuk diputus. /ws/ticker mengirim harga saham deterministik setiap detik (?count=, maksimal 300). Request HTTP biasa mendapat 400 yang menjelaskan cara terhubung.

Contoh request

Open a WebSocket that echoes every message back. Referensi lengkap dan tombol Send (dalam bahasa Inggris).

cURL
curl -X GET "https://api.testingapis.com/ws/echo"
Response ·
WebSocket. Connect with ws://{host}/ws/echo. Every text or binary message is echoed back; send "close" to make the server close the socket.
> hello
< hello
> close
< (server closes: 1000 "Bye!")