C# 在C中使用Webpush发送通知后没有响应#
我正在使用Webpush库向web应用发送Webpush通知,我已经开发了用于发送推送通知的API库中有一个名为SendNotification的方法,点击API后,没有响应。[[1]:C# 在C中使用Webpush发送通知后没有响应#,c#,web,push-notification,asp.net-web-api2,web-push,C#,Web,Push Notification,Asp.net Web Api2,Web Push,我正在使用Webpush库向web应用发送Webpush通知,我已经开发了用于发送推送通知的API库中有一个名为SendNotification的方法,点击API后,没有响应。[[1]: URL不正确,服务器未运行,或者您没有到服务器的路由。URL是正确的,我确信&server也在运行,&https证书已经安装。请帮助我。您可以打开浏览器并将URL粘贴到地址中,看看fiddler响应是什么吗?您可以在这里看到fiddler响应fiddler响应来自您的应用程序。我想查看IE手动执行的响应。 pu
URL不正确,服务器未运行,或者您没有到服务器的路由。URL是正确的,我确信&server也在运行,&https证书已经安装。请帮助我。您可以打开浏览器并将URL粘贴到地址中,看看fiddler响应是什么吗?您可以在这里看到fiddler响应fiddler响应来自您的应用程序。我想查看IE手动执行的响应。
public HttpResponseMessage sendNotification(Notification notify)
{
try
{
var subscription = new PushSubscription(notify.endPoint, notify.p256dh, notify.auth);
if (subscription != null)
{
client.SendNotification(subscription, "clarifide notification received");
return Request.CreateResponse(HttpStatusCode.OK, notify);
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Internal Server Error");
}
}
catch (WebPushException e)
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e.Message);
}
}