Moments.Insert with URL返回错误的请求(400)错误代码

时间:2014-08-01 13:30:40

标签: c# .net google-plus google-api-dotnet-client

我试图使用Google提供的.NET库在Google+应用上插入片刻。我需要使用URL(这是一个要求),但它在执行Insert后总是给我400错误代码(错误请求)。代码是这样的(我从示例应用程序获取登录按钮,没什么特别的!)

 if (context.Request.Path.Contains("/moment"))
  {
     Moment moment = new Moment();
     moment.Type = "http://schema.org/AddAction";
     ItemScope itemScope = new ItemScope();
     itemScope.Id= "target-id-1";
     itemScope.Url = "anyURLyoucanthink";  

     moment.Target = itemScope;
     Moment momentResult = ps.Moments.Insert(moment, gplus_id,
     MomentsResource.InsertRequest.CollectionEnum.Vault).Execute();
  }

我尝试了不同的网址,这不是我认为的问题。真正引起我注意的一件事是,在Google+文档的时刻插入(Here)上,.NET示例是唯一一个没有"使用URL"和#34;没有网址"例子,所有其他选项都有。也许它不再受新版本的支持?

谢谢!

0 个答案:

没有答案
相关问题