| | |
| | | Stream stream = null; |
| | | WebResponse rsp = null; |
| | | try { |
| | | |
| | | rsp = request.GetResponse(); |
| | | stream = rsp.GetResponseStream(); |
| | | reader = new StreamReader(stream); |
| | |
| | | if (stream != null) stream.Close(); |
| | | if (rsp != null) rsp.Close(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public string Post(string url, string postData, string contentType = "application/json", string sessionId = "") { |
| | |
| | | if (stream != null) stream.Close(); |
| | | if (rsp != null) rsp.Close(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public string Post(string url, Dictionary<string, string> dic) { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | LogHelper.Info($"PostWithCookie res={e.Message}", "API"); |
| | | return ""; |
| | | } |
| | |
| | | if (stream != null) stream.Close(); |
| | | if (rsp != null) rsp.Close(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public string Put(string url, string postData, string contentType = "application/json", string sessionId = "") |