Demo entry 6350129

test

   

Submitted by yyyyy on Mar 06, 2017 at 11:43
Language: C#. Code size: 2.7 kB.

using System;
                                                using System.Net.Http.Headers;
                                                using System.Text;
                                                using System.Net.Http;
                                                using System.Web;
                                                namespace CSHttpClientSample
                                                {
                                                    static class Program
                                                    {
                                                        static void Main()
                                                        {
                                                            MakeRequest();
                                                            Console.WriteLine("Hit ENTER to exit...");
                                                            Console.ReadLine();
                                                        }
        
                                                        static async void MakeRequest()
                                                        {
                                                            var client = new HttpClient();
                                                            var queryString = HttpUtility.ParseQueryString(string.Empty);
                                                            // Request headers
                                                            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
                                                            var uri = "https://api.exactgst.com/ForgotPassword/api/authentication/ResetPassword?" + queryString;
                                                            HttpResponseMessage response;
                                                            // Request body
                                                            byte[] byteData = Encoding.UTF8.GetBytes("{body}");
                                                            using (var content = new ByteArrayContent(byteData))
                                                            {
                                                               content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
                                                               response = await client.PostAsync(uri, content);
                                                            }
                                                        }
                                                    }
                                                }	

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).