|
|
@@ -18,6 +18,8 @@ import org.apache.http.client.CookieStore;
|
|
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
import org.apache.http.client.methods.HttpPost;
|
|
|
+import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
|
|
|
+import org.apache.http.conn.ssl.SSLSocketFactory;
|
|
|
import org.apache.http.impl.client.DefaultHttpClient;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.apache.http.params.CoreConnectionPNames;
|
|
|
@@ -99,6 +101,7 @@ public class HttpClient {
|
|
|
|
|
|
public String sendPostRequest(String url, Map<String, String> params)
|
|
|
throws IOException {
|
|
|
+ SSLSocketFactory.getSocketFactory().setHostnameVerifier(new AllowAllHostnameVerifier());
|
|
|
Log.i("HTTP", "post url=" + url);
|
|
|
String result = null;
|
|
|
HttpResponse response = null;
|
|
|
@@ -130,7 +133,7 @@ public class HttpClient {
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (response.getStatusLine().getStatusCode() == 200
|
|
|
|| response.getStatusLine().getStatusCode() == 207) {
|
|
|
String temp = EntityUtils.toString(response.getEntity());
|