3
我正在研究需要更新Google日历的应用程序。Google Calendar Ruby API
通过在下面的谷歌日历开发指南:
http://code.google.com/apis/calendar/v3/using.html#creating_events
event = {
'summary' => 'Appointment',
'location' => 'Somewhere',
'start' => {
'dateTime' => '2011-06-03T10:00:00.000-07:00'
},
'end' => {
'dateTime' => '2011-06-03T10:25:00.000-07:00'
}
}
result = client.execute(:api_method => service.events.insert,
:parameters => {'calendarId' => 'primary'},
:body => JSON.dump(event),
:headers => {'Content-Type' => 'application/json'})
我得到以下错误:
TypeError (Expected body to respond to :each.):
我试图做event.to_json为好。
这两个建议的工作。谢谢。 – y4ku 2011-12-20 15:15:56