Esempio n. 1
0
        /// <summary>
        /// POST数据
        /// </summary>
        /// <param name="requestUrl"></param>
        /// <param name="parameters"></param>
        /// <param name="files"></param>
        /// <param name="callback"></param>
        protected virtual void PostData(string requestUrl, Parameters parameters, Files files, Action <string> callback)
        {
            this.LastError = null;

            var request = new AsyncHttpRequest(requestUrl, Charset)
            {
                Parameters = parameters
            };

            if (files != null)
            {
                request.PostFile(EndGetResponseData, files, callback);
            }
            else
            {
                request.Post(EndGetResponseData, callback);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// POST数据
        /// </summary>
        /// <param name="requestUrl"></param>
        /// <param name="parameters"></param>
        /// <param name="files"></param>
        /// <param name="callback"></param>
        protected virtual void PostData(string requestUrl, Parameters parameters, Files files, Action <string> callback)
        {
            this.LastError = null;
            this.AddOAuthParameter("POST", requestUrl, parameters);
            var request = new AsyncHttpRequest(requestUrl, this.OAuth.Charset)
            {
                Parameters = parameters, AuthHeader = AuthHeaderStr
            };

            if (files != null)
            {
                request.PostFile(EndGetResponseData, files, callback);
            }
            else
            {
                request.Post(EndGetResponseData, callback);
            }
        }