Ejemplo n.º 1
0
        private void cmdGO_Click(object sender, EventArgs e)
        {
            RESTClient rClient = new RESTClient();

            rClient.endPoint = txtRequestURI.Text;
            debugOutput("RESTClient Object created.");

            string strJSON = string.Empty;

            strJSON = rClient.makeRequest();

            debugOutput(strJSON);
        }
Ejemplo n.º 2
0
        private void cmdGO_Click(object sender, EventArgs e)
        {
            string strJSON = string.Empty;

            if (!CBMirConnection.Checked)
            {
                RESTClient rClient = new RESTClient();
                rClient.endPoint = txtRequestURI.Text;
                debugOutput("RESTClient Object created.");

                strJSON = rClient.makeRequest();
            }
            else
            {
                RESTClient rClient = new RESTClient();

                rClient.endPoint = "http://www.mir.com/api/v2.0.0/registers/1";

                debugOutput("RESTClient Object created.");
                int iA, iB;
                if (int.TryParse(tbID.Text, out iA) && int.TryParse(tbValue.Text, out iB))
                {
                    strJSON = rClient.makeRequestMir(iB);
                }
                else
                {
                    // Initializes the variables to pass to the MessageBox.Show method.
                    string            message = "Please insert both Numbers";
                    string            caption = "Error";
                    MessageBoxButtons buttons = MessageBoxButtons.OK;
                    DialogResult      result;

                    // Displays the MessageBox.
                    result = MessageBox.Show(message, caption, buttons);
                    //if (result == System.Windows.Forms.DialogResult.Yes)
                    //{
                    //    // Closes the parent form.
                    //    this.Close();
                    //}
                }
            }


            debugOutput(strJSON);
        }