public static IRestResponse RestPost(string url, object bodyRawObj) { var request = new RestRequest(Method.POST); request.Timeout = 30000; request.RequestFormat = DataFormat.Json; request.AddBody(bodyRawObj); //Body Raw Format ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3; var resp = new RestClient(url).Post(request); return resp; }
标签:Body,url,resp,request,Raw,RestSharp,SecurityProtocolType From: https://www.cnblogs.com/leavind/p/17957810