| | |
| | | using System.Net.Cache; |
| | | using System.Net; |
| | | using System.Text; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using System.Net; |
| | | using System.Net.Cache; |
| | | using System.Text; |
| | | |
| | | |
| | | namespace Gs.Toolbox; |
| | |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json"; |
| | | request.Accept = "*/*"; |
| | | request.Timeout = 150000; |
| | | //request.Timeout = 150000; |
| | | request.AllowAutoRedirect = false; |
| | | request.ServicePoint.Expect100Continue = false; |
| | | HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); |
| | |
| | | responseStr = reader.ReadToEnd(); |
| | | reader.Close(); |
| | | } |
| | | // LogHelper.Debug(url, "HttpPostErp response:" + param + ",response:" + responseStr.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | requestStream = null; |
| | | response = null; |
| | | } |
| | | //{"msg":"操作成功","code":200,"data":{"number":"CGSL168397","code":"200","id":"268781"}} |
| | | if (_rtn != -1) |
| | | { |
| | | Result _result = JsonConvert.DeserializeObject<Result>(responseStr); |
| | | if ("200".Equals(_result.state)) |
| | | if ("200".Equals(_result.code)) |
| | | _rtn = 1; |
| | | } |
| | | sbLog.Append("," + DateTime.Now.ToString() + "结束发送"); |
| | |
| | | return (_rtn, (_rtn > 0 ? strLogGuid : responseStr)); |
| | | } |
| | | } |
| | | |
| | | //{"msg":"操作成功","code":200,"data":{"number":"CGSL168397","code":"200","id":"268781"}} |
| | | public class Result |
| | | { |
| | | /// <summary> |
| | | /// 200成功,否则失败 |
| | | /// </summary> |
| | | public string? state { get; set; } |
| | | /// |
| | | |
| | | public string? msg { get; set; } |
| | | |
| | | public string? status { get; set; } |
| | | |
| | | public string? message { get; set; } |
| | | public string? code { get; set; } |
| | | // public string? data { get; set; } |
| | | } |