Browse Source

调整httpget方法

zhengbingbing 5 years ago
parent
commit
60dea9281e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      codegit/CallCenterCommon/CallCenter.Utility/Http/HttpMethods.cs

+ 3 - 2
codegit/CallCenterCommon/CallCenter.Utility/Http/HttpMethods.cs

@@ -19,7 +19,7 @@ namespace CallCenter.Utility
19 19
         /// <param name="url">URL.</param>
20 20
         /// <param name="param">POST的数据</param>
21 21
         /// <returns></returns>
22
-        public static string HttpPost(string url, string param = null)
22
+        public static string HttpPost(string url, string param = null,string contenttype= "application/x-www-form-urlencoded")
23 23
         {
24 24
             HttpWebRequest request;
25 25
 
@@ -36,7 +36,8 @@ namespace CallCenter.Utility
36 36
             }
37 37
 
38 38
             request.Method = "POST";
39
-            request.ContentType = "application/x-www-form-urlencoded";
39
+            request.ContentType = contenttype;
40
+            //request.ContentType = "application/json";
40 41
             request.Accept = "*/*";
41 42
             request.Timeout = 15000;
42 43
             request.AllowAutoRedirect = false;