public void GetData(string method, object args, XClientResponseReceived internalCallback, XDataReceived userCallback) { var requestState = new XRequestState { InternalCallback = internalCallback, UserCallback = userCallback, JsonRequest = BuildJsonPost(method, args), Request = (HttpWebRequest)WebRequest.Create(_Settings.XJsonInterfaceAddress) }; requestState.Request.Credentials = new NetworkCredential(_Settings.UserName, _Settings.Password); requestState.Request.ContentType = "application/json"; requestState.Request.Method = "POST"; requestState.Request.BeginGetRequestStream(ResponseStreamReceived, requestState); }
public void GetData(string method, object args, XClientResponseReceived internalCallback, XDataReceived userCallback) { var requestState = new XRequestState { InternalCallback = internalCallback, UserCallback = userCallback, JsonRequest = BuildJsonPost(method, args), Request = (HttpWebRequest) WebRequest.Create(mSettings.XJsonInterfaceAddress), RequestOperation = method }; requestState.Request.Credentials = new NetworkCredential(mSettings.UserName, mSettings.Password); requestState.Request.ContentType = "application/json"; requestState.Request.Method = "POST"; requestState.Request.BeginGetRequestStream(ResponseStreamReceived, requestState); }