C
C#3mo ago
Defxult

ClientWebSocket doesn't connect with URI query params

For some reason, when connecting via web socket, the URI query params are ignored. For example, lets say I want to connect to an API but their version 6.
ClientWebSocket webSocket = new();

Uri uri = new("wss://example.com/?version=6");

await webSocket.ConnectAsync(uri, CancellationToken.None);
ClientWebSocket webSocket = new();

Uri uri = new("wss://example.com/?version=6");

await webSocket.ConnectAsync(uri, CancellationToken.None);
By default, if the version query param is not specified, the API defaults to version 1. Even though I specify version 6, I can only do things available in v1 of the API, not v6. So that's how I know the query param is being ignored. Does anyone know what could be happening? 🤔
3 Replies
unhAPI
unhAPI3mo ago
that's a parameter of the api, websocket has nothing to do with it 🤷‍♂️ i mena how do you know it takes the version parameter, is it in a doc?
Defxult
Defxult3mo ago
yes it's in the docs
unhAPI
unhAPI2mo ago
you can look at the request that's being made with tools like fiddler but i would find it weird that .net's the problem
Want results from more Discord servers?
Add your server