执行认证请求返回意想不到的结果:404
问题描述:
当我实现了谷歌日历下面的错误提示:执行认证请求返回意想不到的结果:404
认证请求的执行返回意想不到的结果:404
代码:
Dim service As New CalendarService("cal1")
Dim entry As EventEntry = New EventEntry()
entry.Title.Text = Title
entry.Content.Content = Desc
Dim eventLocation As Where = New Where()
eventLocation.ValueString = Location
entry.Locations.Add(eventLocation)
'Dim dtstartdatetime As DateTime = New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 3, 30, 0)
Dim dtstartdatetime As DateTime = StartTime
'Dim dtenddatetime As DateTime = New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 4, 30, 0)
Dim dtenddatetime As DateTime = EndTime
Dim eventTime As [When] = New [When](dtstartdatetime, dtenddatetime)
entry.Times.Add(eventTime)
If (UserName <> "" And UserName.Length > 0) Then
service.setUserCredentials(UserName, Password)
End If
Dim uripath As String = "http://www.google.com/calendar/feeds/" + UserName + "/private/full"
Dim postUri = New Uri("http://www.google.com/calendar/feeds/default/private/full")
postUri = New Uri(uripath)
Dim requestFactory As GDataGAuthRequestFactory = service.RequestFactory
requestFactory.CreateRequest(GDataRequestType.Insert, postUri)
Dim insertedEntry As AtomEntry = service.Insert(postUri, entry)
答
此方法是旧版本,服务于2014年关闭。请参阅下面的链接 https://gsuiteupdates.googleblog.com/2014/10/deprecated-google-calendar-apis-v1-v2.html
你确定:'http:// www.google.com/calendar/feeds/default/private/full'是写入地址吗?检查文档:https://developers.google.com/google-apps/calendar/quickstart/dotnet – Mederic
感谢您的帮助Mederic。 地址(http://www.google.com/calendar/feeds/default/private/full)适用于旧版本,并于2014年关闭。 https://gsuiteupdates.googleblog.com/2014/10 /deprecated-google-calendar-apis-v1-v2.html – John