Exemple #1
0
        private static string cmdGO_Click()
        {
            RESTClient rClient       = new RESTClient();
            string     txtRequestURI = "http://dry-cliffs-19849.herokuapp.com/users.json";

            rClient.endPoint = txtRequestURI;
            string strJSON = string.Empty;

            strJSON = rClient.makeRequest();
            return(strJSON);
        }
Exemple #2
0
        private static string get_Weather_InCity()
        {
            string     api_key       = "782792da0e998344afa4a6cc73d7e890";
            RESTClient rClient       = new RESTClient();
            string     txtRequestURI = "https://api.openweathermap.org/data/2.5/weather?q=Moscow&appid=782792da0e998344afa4a6cc73d7e890";

            rClient.endPoint = txtRequestURI;
            string strJSON = string.Empty;

            strJSON = rClient.makeRequest();
            return(strJSON);
        }
Exemple #3
0
        //private static string get_Weather_InCity(string city)
        //{
        //    string api_key = "782792da0e998344afa4a6cc73d7e890";
        //    RESTClient rClient = new RESTClient();
        //    string txtRequestURI = "https://api.openweathermap.org/data/2.5/weather?q="+ city + "&appid=" + api_key;
        //    rClient.endPoint = txtRequestURI;
        //    string strJSON = string.Empty;
        //    strJSON = rClient.makeRequest();
        //    return strJSON;
        //}


        private static Weather_Model get_Weather_InCity(string city)
        {
            string     api_key       = "782792da0e998344afa4a6cc73d7e890";
            RESTClient rClient       = new RESTClient();
            string     txtRequestURI = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid=" + api_key;

            rClient.endPoint = txtRequestURI;
            string strJSON = string.Empty;

            strJSON = rClient.makeRequest();
            Weather_Model myDeserializedClass = JsonConvert.DeserializeObject <Weather_Model>(strJSON);

            return(myDeserializedClass);
        }