SignalR: hub invokation request
- by Yuriy Pogrebnyak
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?