[英]How to send an image to a Javascript client using JSON from a Java server
[英]Send a json object to .net server using signalr and Java client
我正在使用 SignalR 5.0,我正在尝试从 Android 客户端发送 JSON。 我已经看着这个。 但它对我不起作用,发送工作我在测试中得到了 json "{"Id":"123123","ReceviedDateTime":"Nov 23, 2020 12:50:55 PM","RepliedDatetime":"Nov 23, 2020 12:50:55 PM"}" 但从未调用 Pong 方法。 添加了 services.AddSignalR().AddJsonProtocol(); 在启动
乒乓球模型:
public class PongModel
{
public int Id { get; set; }
public int DeviceId { get; set; }
public string PhoneNumber { get; set; }
public DateTime SendDatetime { get; set; }
public DateTime ReceviedDateTime { get; set; }
public DateTime RepliedDatetime { get; set; }
}
方法(.net core 5)
public void Pong(PongModel pongModel)
{
}
public void Send(string test)
{
}
不序列化直接传递对象示例: hubConnection.send("Pong", p); 添加此以获得绑定错误:“Microsoft.AspNetCore.SignalR”:“调试”,“Microsoft.AspNetCore.Http.Connections”:“调试”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.