Ejemplo n.º 1
0
        public String returnRestForWit(string msg)
        {
            m_helper = new RestService();
            headers  = new WebHeaderCollection();
            headers["Authorization"] = "Bearer CP3CQQTLQE6OFM272PNVYQ5I6CLGSH6J";

            string param = "";

            wit_url = wit_url + "&q=" + RestService.FormatTextForJSON(msg);


            string reply = string.Empty;

            try
            {
                var json = m_helper.CallRestService(wit_url, "GET", param, headers);

                WitReply witreply = new WitReply(json);

                reply = witreply.chatReply;

                //reply = witreply.chatReply;
                //reply = new WitReply(value);
            }
            catch (Exception ex)
            {
                reply = ex.Message;
            }

            return(reply);
        }