android post

来源:互联网 发布:信鸽软件官网 编辑:程序博客网 时间:2024/06/05 11:31
public void postConfig(String key, String val){String post = mPrefs.getMac()+"=>"+key+"=>"+val;final HttpClient httpclient = new DefaultHttpClient();final HttpPost httppost = new HttpPost(mPrefs.getAddress());List <NameValuePair> params=new ArrayList<NameValuePair>();  params.add(new BasicNameValuePair("config",post));  try {httppost.setEntity(new UrlEncodedFormEntity(params,HTTP.ISO_8859_1));} catch (UnsupportedEncodingException e1) {}EX.execute(new Runnable() {public void run() {try {httpclient.execute(httppost);} catch (ClientProtocolException e) {} catch (IOException e) { }}});}

原创粉丝点击