0

.NET 라이브러리와 함께 Google 캘린더 API를 사용하고 있습니다. 이미 내 프로젝트와 Google 캘린더 푸시 알림간에 채널을 만들 수 있습니다. Webhook 주소를 설정하고 있습니다. 내가 헤더Google 캘린더 푸시 알림

[System.Web.Mvc.HttpPost] 
    public string CalendarWebhook() 
    { 

     HttpContext ctx = HttpContext.Current; 
     if (ctx == null || ctx.Request == null || ctx.Request.Headers == null) 
     { 
      return string.Empty; 
     } 
     string headers = string.Empty; 
     foreach (string header in ctx.Request.Headers.AllKeys) 
     { 
      string[] values = ctx.Request.Headers.GetValues(header); 
      headers += string.Format("{0}: {1}", header, string.Join(",", values)); 
     } 


     return ""; 
    } 

을 읽기에는 너무 수 있어요 지금은 몸을 읽어보십시오. 그러나 아무것도 작동하지 않습니다. 난 이미

var test = HttpContext.Current.Request.InputStream; 
    var sr = new StreamReader(test); 
    string documentContents = sr.ReadToEnd(); 

또는

    using (Stream receiveStream = HttpContext.Current.Request.InputStream) 
       { 
        using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8)) 
        { 
         documentContents = readStream.ReadToEnd(); 
        } 
       } 

을 시도했지만 작동하지 않았다. 그리고 나는 어떤 예제 나 문서도 찾을 수 없었다. 모든 신체가 나를 도울 수 있기를 바랍니다. 선배 들께 고맙습니다.

+0

[Push Notifications] (https://developers.google.com/google-apps/calendar/v3/push) 전체 설정 안내를 확인 했습니까? – noogui

답변

관련 문제