Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Using Query String #22

Closed
oatcrunch opened this issue Mar 21, 2017 · 4 comments
Closed

Question: Using Query String #22

oatcrunch opened this issue Mar 21, 2017 · 4 comments

Comments

@oatcrunch
Copy link

Hi,

Just a simple query, how do I include query string using this library? The example in C# would be as follows:

var qs = "username=rendang";
var url = "http://192.168.93.139/SignalRHub/";
hubConnection = new HubConnection(url, qs);

Do we have the equivalent way of doing this? I tried using the traditional way using this library, but doesn't seem to work ie:

let qs = "username=rendang";
let url = "http://192.168.93.139/SignalRHub";
let fullUrl = url + "?" + qs;
const connection = signalr.hubConnection(fullUrl);

And this way as well:

let qs = "username=rendang";
let url = "http://192.168.93.139/SignalRHub";

    let fullUrl = url;
    const connection = signalr.hubConnection(fullUrl, qs);

Appreciate some advice.

Note: Sorry, I am very new to JS and ES6 language.

@oatcrunch
Copy link
Author

Hi, is there any kind soul with the knowledge to help on the above query? If the this feature exists kindly provide some guidance on how can it be done; or any workaround will also be fine.

Thanks in advance.

@olofd
Copy link
Owner

olofd commented Apr 3, 2017

@oatcrunch I think you do it this way, by sending it in the options-object.

const connection = signalr.hubConnection(fullUrlWithoutQueryString, {
 qs : "username=rendang"
});

Let me know if it does not work!

@oatcrunch
Copy link
Author

Hi @olofd . I have tested your suggested method. It works :) Thanks for your help.

@olofd
Copy link
Owner

olofd commented Apr 4, 2017

@oatcrunch Great! Then I'm closing this issue.

@olofd olofd closed this as completed Apr 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants