I understand the differences of Post(Add) and Put(Update) in Web Api. However, which one should I use in SignalR. When I am developing a Chat App
That is Hub Class
public class ChatHub : Hub
{
....
}
That is ApiController Class
public class ChatClientController : ApiController
{
// [HttpPost] or [HttpPut]??
public bool Connect(ChatConnectionViewModel model)
{
//connection method
}
//[HttpPost] or [HttpPut] ??
public bool SendTextMessage(MessageViewModel model)
{
//send message method
}
}
My Question is:
1. When Client Side send a web api request to call Connect method, which request method should I use? Post or Put?
- When Client Side send a web api request to call SendTextMessagemethod, which request method should I use? Post or Put?
In addition
My goal is to send Image file via SignalR. I just got an idea from this, so I am using signalR via Web Api. Any answers?