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

Add header #2

Closed
AliEasy opened this issue Sep 9, 2020 · 2 comments · Fixed by #3
Closed

Add header #2

AliEasy opened this issue Sep 9, 2020 · 2 comments · Fixed by #3
Assignees
Labels
enhancement New feature or request

Comments

@AliEasy
Copy link

AliEasy commented Sep 9, 2020

Hi
How can I add parameter to the connect request?

This is what I do on Java and I want to do sth like this:

            Platform.loadPlatformComponent(new AndroidPlatformComponent());
            Credentials credentials = new Credentials() {
                @Override
                public void prepareRequest(Request request) {
                    request.addHeader("userId", 3 + "");
                }
            };
            String serverUrl = "http://xxxxxx/";
            mHubConnection = new HubConnection(serverUrl);
            mHubConnection.setCredentials(credentials);
            String SERVER_HUB_CHAT = "notificationHub";
            mHubProxy = mHubConnection.createHubProxy(SERVER_HUB_CHAT);
            ClientTransport clientTransport = new ServerSentEventsTransport(mHubConnection.getLogger());
            SignalRFuture<Void> signalRFuture = mHubConnection.start(clientTransport);
            signalRFuture.get();
             mHubProxy.on("RecieveNotification", new SubscriptionHandler1<String>() {
                @Override
                public void run(final String string) {
                 ....
                }
             }

Thanks in advance.

@AyonAB AyonAB self-assigned this Sep 9, 2020
@AyonAB AyonAB added the enhancement New feature or request label Sep 9, 2020
@AyonAB
Copy link
Contributor

AyonAB commented Sep 9, 2020

Hey @AliEasy, currently there is no way to set headers. But i'm planning to add this. Should be available in the next update.

@AyonAB
Copy link
Contributor

AyonAB commented Sep 12, 2020

@AliEasy now you should be able to set headers. Just grab the latest version from pub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants