0

I want to create Storage Plugin through C#(.NET) code, when Drill is install in some other system(not in local).? Is it Possible?? If yes then how.?

Sanjiv
  • 440
  • 1
  • 7
  • 26
  • And what is the question? Please have a look at http://stackoverflow.com/help/how-to-ask first before asking non-questions. – HimBromBeere Mar 11 '16 at 14:38
  • Whether is it possible or not to create Storage Plugin through C#(.NET) code, when Drill is install in some other system(not in local).? If yes then how..??? – Sanjiv Mar 11 '16 at 14:40

1 Answers1

1

I found out some solution for that:

           var request = (HttpWebRequest)WebRequest.Create(url);
           var postData = "name=" + name + "&config=" + config;
           var data = Encoding.ASCII.GetBytes(postData);
           request.Method = "POST";
           request.ContentType = "application/x-www-form-urlencoded";
           request.ContentLength = data.Length;
           using (var stream = request.GetRequestStream())
           {
               stream.Write(data, 0, data.Length);
           }
           var response = (HttpWebResponse)request.GetResponse();
           var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
           if (responseString != null)
           {
               var jsonObject = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responseString);
               return jsonObject.result == "success";
           }
Sanjiv
  • 440
  • 1
  • 7
  • 26