Beispiel #1
0
        public async Task <IHttpActionResult> Tell()
        {
            string payload   = "not GET or POST...";
            string challenge = string.Empty;

            if (Request.Method == HttpMethod.Post)
            {
                payload = "POST " + await Request.Content.ReadAsStringAsync();
            }
            else if (Request.Method == HttpMethod.Get)
            {
                payload   = "GET " + Request.RequestUri.Query;
                challenge = Request.RequestUri.ParseQueryString()["hub.challenge"];
            }

            TraceHub.Trace(Request.RequestUri.AbsolutePath, User, payload);

            if (!string.IsNullOrEmpty(challenge))
            {
                return(Content(HttpStatusCode.Accepted, challenge, new TextMediaTypeFormatter()));
            }

            return(Ok());
        }
Beispiel #2
0
        // GET api/values
        public IEnumerable <string> Get()
        {
            TraceHub.Trace(Request.RequestUri.AbsolutePath, User, "");

            return(new string[] { "value1", "value2" });
        }