Consumer.GoGetSomeJsonForMePleaseKThxBai C# (CSharp) Метод

GoGetSomeJsonForMePleaseKThxBai() публичный Метод

public GoGetSomeJsonForMePleaseKThxBai ( ) : Foo
Результат Foo
         public Foo GoGetSomeJsonForMePleaseKThxBai()
        {
            // prep stuff ...
        
            // Now get json please.
            HttpWebRequest httpWebRequest = WebRequestFactory.Create("Http://some.fancypants.site/api/hiThere);
            httpWebRequest.Method = WebRequestMethods.Http.Get;
        
            string responseText;
        
            using (var httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse())
            {
                using (var streamReader = new StreamReader(httpWebResponse.GetResponseStream()))
                {
                    json = streamReader.ReadToEnd().ToLowerInvariant();
                }
            }
        
            // Check the value of the json... etc..
        }