小编use*_*234的帖子

服务器发送事件vs Web套接字?

我正在开发一个网络应用程序,用户可以通过从智能手机到桌面的多个平台访问这些应用程序,有时需要在两个客户端之间进行通信,例如,如果我希望我的朋友加入我的网络,我会向他发送朋友请求但是我希望我的朋友能够看到该请求而无需刷新页面.

在这种情况下,这将是一个更好的选择?此外,我希望这个可以在尽可能多的平台和浏览器上工作,这些平台和浏览器有更多的浏览器支持?有更好的选择吗?

javascript websocket server-sent-events

11
推荐指数
1
解决办法
1万
查看次数

RPC vs REST与WCF?

您好我正在使用Web应用程序,我希望您能够使用正确的方法来实现我的API.

RPC是我开始实现它的方式,因为作为一个新的Web开发人员,这是最合乎逻辑的事情,但我一直在关注RESTful和WCF,因为我的研究已经多次提到它们.

具有用于更复杂的业务逻辑密集型数据操作的RPC接口和用于"休息"的类似REST的接口是常见的.

rest wcf rpc

6
推荐指数
1
解决办法
2703
查看次数

Google云端存储上传无法使用C#API

我正在尝试通过C#API将简单图像上传到Google云存储.它似乎成功了,但我的Google云端存储桶中没有任何内容.

我到目前为止的代码:

Google.Apis.Services.BaseClientService.Initializer init = new Google.Apis.Services.BaseClientService.Initializer();
init.ApiKey = "@@myapikey@@";
init.ApplicationName = "@@myapplicationname@@";

Google.Apis.Storage.v1.StorageService ss = new Google.Apis.Storage.v1.StorageService(init);

var fileobj = new Google.Apis.Storage.v1.Data.Object()
{
    Bucket = "images",
                    Name = "some-file-" + new Random().Next(1, 666)
};

Stream stream = null;
stream = new MemoryStream(img);

Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload insmedia;
insmedia = new Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload(ss, fileobj, "images", stream, "image/jpeg");
insmedia.Upload();
response.message = img.Length.ToString();
Run Code Online (Sandbox Code Playgroud)

c# google-api google-cloud-storage google-api-dotnet-client

1
推荐指数
1
解决办法
1934
查看次数