httpclient 4.0.1 learning

HttpClient client = new DefaultHttpClient ();
        HttpPost post = new HttpPost(url);
        List<NameValuePair> data = Lists.newArrayList();
        data.add(new BasicNameValuePair("sign","sign+md5"));
        try {
            post.setEntity(new UrlEncodedFormEntity(data));
            client.execute(post);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

你可能感兴趣的:(httpclient)