HTTP Post使用Thread

时间:2015-03-21 10:27:06

标签: php android multithreading http-post server

我想使用HTTP Post方法使用Android中的线程方法向服务器(www.000webhost.com)发送字符串。但遗憾的是它没有响应`HttpPost httppost = new HttpPost(“http://192.168.2.1:53811/WinnerSite/WebService.asm/MyMethod

try {
    // Add your data
    List nameValuePairs = new ArrayList(2);
    nameValuePairs.add(new BasicNameValuePair("json", name));
  //  nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!"));
    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

    // Execute HTTP Post Request
    HttpResponse response = httpclient.execute(httppost);`

0 个答案:

没有答案