Demo entry 6344541

s

   

Submitted by c on Jan 14, 2017 at 05:31
Language: C#. Code size: 691 Bytes.

        public Reply(ReplyBody body)
        {
            /*
                --- set header and body required infos ---
            */
            req = WebRequest.Create(API_URL);
            req.Method = "POST";
            req.ContentType = "application/json";
            req.Headers["Authorization"] = "Bearer " + WebConfigurationManager.AppSettings["AccessToken"];

            using (var streamWriter = new StreamWriter(req.GetRequestStream()))
            {
                string data = JsonConvert.SerializeObject(body);
                Trace.WriteLine(data);
                streamWriter.Write(data);
                streamWriter.Flush();
            }
        }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).