string pResponse = ""; try { string ret = string.Empty; // Here we create the request and write the POST data to it. var request = (HttpWebRequest)HttpWebRequest.Create("http://test.test.net/api/app/postupload?userid=1&rows=[{'epc':'0090720150000000000000003','deployed_time':'9/6/15 12:00:00 AM','sort_time':'9/6/15 12:00:00 AM','harvest_time':'9/6/15 12:00:00 AM','Status':'H '},{'epc':'09009072015000000000000000372','deployed_time':'10/1/15 12:00:00 AM','sort_time':'','harvest_time':'','Status':'D '},{'epc':'0907201500000000000000030','deployed_time':'2/6/15 12:00:00 AM','sort_time':'2/6/15 12:00:00 AM','harvest_time':'','Status':'S '}]"); request.Method = "POST"; request.Timeout = 1000000; request.UserAgent = ".NET Framework Test Client"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (HttpStatusCode.OK == response.StatusCode) { Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); ret = reader.ReadToEnd(); // login = Newtonsoft.Json.JsonConvert.DeserializeObject<clsgeneral>(ret); response.Close(); } } catch (WebException ex) { string strReturn = string.Empty; switch (ex.Status) { case WebExceptionStatus.ProtocolError: if (ex is WebException && ((WebException)ex).Status == WebExceptionStatus.ProtocolError) { var resp = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd(); } else strReturn = "Protocol error"; break; case WebExceptionStatus.ConnectFailure: strReturn = "Connect Failure"; break; default: strReturn = new StreamReader(ex.Response.GetResponseStream()) .ReadToEnd(); break; } pResponse = ex.Message.ToString(); } catch (Exception cc) { pResponse = cc.Message.ToString(); } finally { }
AEPS RESPONSE CODE: NA AEPS MESSAGE: Response from :npci_api BALANCE Message :The remote server returned an error: (500) Internal Server Error. RRN: DEVICE TXN:
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)