[英]execution of request failed https //www.google.com/calendar/feeds/default/allcalendars/full
[英]Execution of request failed: https://www.google.com/calendar/feeds/default/private/full
我正在嘗試通過接受Winform中的事件詳細信息來將事件添加到Google日歷中
嘗試添加事件時,出現以下錯誤“請求執行失敗: https : //www.google.com/calendar/feeds/default/private/full ”
代碼如下:
CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
myService.setUserCredentials("username@gmail.com", "password");
EventEntry entry = new EventEntry();
entry.Title.Text = textBox1.Text;
entry.Content.Content = textBox2.Text;
Where eventLocation = new Where();
eventLocation.ValueString = textBox3.Text;
entry.Locations.Add(eventLocation);
When eventTime = new When();
eventTime.StartTime =Convert.ToDateTime(textBox4.Text);
entry.Times.Add(eventTime);
Uri postUri = new Uri("http://www.google.com/calendar/feeds/default/private/full");
AtomEntry insertedEntry = myService.Insert(postUri, entry);
有人可以幫我嗎? 我已經嘗試過基本和完整兩者,並且也刪除了私有內容,我還缺少什么嗎?
im傳遞的日歷憑據可以訪問日歷,並且確實有多個日歷。
我知道所有Google API都需要OAuth 2身份驗證。 我不確定您的CalendarService類是否在使用Google API庫。 好像您自己在做身份驗證?
我強烈建議您使用Google API .Net客戶端簡化所有步驟。 該庫包含Calendar API方法,使其非常簡單。
https://code.google.com/p/google-api-dotnet-client/
https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.