You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue was that when opening a WebSocket connection, kdb+ already adds all the necessary headers (Sec-WebSocket-Key, Sec-WebSocket-Version, Sec-WebSocket-Extensions, Upgrade, Connection) so my code was duplicating (some of) these, which led to "bad requests".
In other words, the solution is simply to simplify ws.q much further. With this change:
q).hbc.upd:{show .j.k x}
q).hbc.h:.ws.open["wss://api.hitbtc.com/api/2/ws";`.hbc.upd]
q).hbc.h
-3i
q).hbc.h .j.j `method`params`id!(`getCurrency;(1#`currency)!1#`ETH;123)
q)jsonrpc| "2.0"
result | `id`fullName`crypto`payinEnabled`payinPaymentId`payinConfirmations`payoutEnabled`payoutIsPaymentId`transferEnabled`delisted`payoutFee!("ETH";"Ethereum";1b;1b;0b;2f;1b;0b;1b;0b;"0.00958")
id | 123f
Small disadvantage is that the verbose mode I added is less effective, as it won't show the kdb+ added headers on the request.
Connection fails, with a 400 Bad Request response:
Reported by @QuickSwitch
The text was updated successfully, but these errors were encountered: