Example #1
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;
        }
Example #2
0
        public static RequestFunc GetInstance()
        {
            if (_requestFunc == null)
            {
                _requestFunc = new RequestFunc();
            }

            return(_requestFunc);
        }