Exemple #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string path = textBoxNewUrl.Text;

            if (string.IsNullOrEmpty(path))
            {
                MessageBox.Show("Can't be Empty!");
                return;
            }

            // add
            RestInfo restInfo = new RestInfo();

            restInfo.Path = path;
            string method = comboNewMethod.SelectedItem.ToString();

            restInfo.SetRequestMethod(method);

            _arrListRestInfo.Add(restInfo);

            // init textbox
            MessageBox.Show("Url was added!");
            textBoxNewUrl.Text = "";

            // refresh
            refreshUrls();
        }
Exemple #2
0
        private void buttonSend_Click(object sender, EventArgs e)
        {
            string path   = textboxUrl.Text;
            string method = comboMethod.SelectedItem.ToString();

            if (string.IsNullOrEmpty(path))
            {
                MessageBox.Show("Can't be empty");
                return;
            }

            if (_curRestInfo == null)
            {
                _curRestInfo = new RestInfo();
            }

            // send request
            _curRestInfo.Path = path;
            _curRestInfo.SetRequestMethod(method);
            string param = KeyInfo.GetJson(_arrListKeys);

            _curRestInfo.Param = param;


            string result = RequestFunc.GetInstance().SendRequest(_curRestInfo);

            // set result
            textBoxResult.Text  = result;
            _curRestInfo.Result = result;
        }