Google Calendar API:HTML中的事件描述 [英] Google Calendar API : event description in HTML

查看:67
本文介绍了Google Calendar API:HTML中的事件描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将事件插入Google日历,但找不到指定说明不是纯文本而是HTML标记的方法:

I'm inserting the event into Google calendar and I can't find the way I can specify that description is not a plain text but the HTML markup:

request = WebRequest.Create("https://www.googleapis.com/calendar/v3/calendars/" + calendarID + "/events?pp=1&key=" + ClientID) as HttpWebRequest;
request.Headers.Add("Accept-Charset", "utf-8");
request.KeepAlive = true;
request.ContentType = "application/json";
request.Method = "POST";
request.Headers.Add("Authorization", "OAuth " + googleToken.ToString());
var actEvent = new GoogleCalendarEvent
    {
    summary = eventCalendar.Title,
    description = eventCalendar.Description,
    start = new GoogleCalendarEventTime(eventCalendar.Date),
    end = new GoogleCalendarEventTime(eventCalendar.Date.AddHours(1))
};

var data = jsonSerializer.Serialize(actEvent);
var postData = Encoding.UTF8.GetBytes(data);
Stream ws = request.GetRequestStream();
ws.Write(postData, 0, postData.Length);
ws.Close();
response = request.GetResponse();
stream = new StreamReader(response.GetResponseStream());
var result = stream.ReadToEnd().Trim();

return Json(new {Success = true});

推荐答案

Google日历事件描述字段仅提供纯文本. :-(

There is only plain text available for Google Calendar Event description field. :-(

这篇关于Google Calendar API:HTML中的事件描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆