SignalR: hub invokation request

Posted by Yuriy Pogrebnyak on Stack Overflow See other posts from Stack Overflow or by Yuriy Pogrebnyak
Published on 2012-10-28T22:58:26Z Indexed on 2012/10/28 22:59 UTC
Read the original article Hit count: 545

Filed under:
|

I'm writing custom SignalR client and I need to implement hub invokation. As I understood from .NET client code, I need to send post request to the following url (after establishing connection with server): http://serverurl/signalr/send?transport=serverSentEvents&connectionId=<my_connection_id> . In request body I need to send json string containing basic information about the invoked method.

My question is how should this json look like? I'm trying to send smth like this (again, judging by .NET client code):

{"data" : {"Hub" : "hubname", "Method" : "methodname", "Args" : {"message" : "msg"} } }

But I get the following error: System.ArgumentNullException: Value cannot be null. Parameter name: s.

What am I doing wrong? What are required parameters of sending json and how should it be formatted?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about signalr